Skip to content

Commit

Permalink
Remove unnecessary changes and add comment explaining logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Nov 27, 2023
1 parent e693e0a commit 1883c1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected String resolvePropertyReferences(String value) {
String replacementValue = project.getProperties().getProperty(varName);
if (replacementValue != null) {
returnValue = returnValue.replace("${"+varName+"}", replacementValue);
getLog().debug("Replaced Liberty configuration property reference ${"+varName+"} with value "+replacementValue);
getLog().info("Replaced Liberty configuration property reference ${"+varName+"} with value "+replacementValue);
}
} else {
getLog().debug("Could not replace property reference: "+varName+" in value: "+value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ public void error(String msg, Throwable e) {
@Override
public File downloadArtifact(String groupId, String artifactId, String type, String version) throws PluginExecutionException {
try {
// Look for and replace maven props in the coordinates
return getArtifact(resolvePropertyReferences(groupId),
resolvePropertyReferences(artifactId),
type,
resolvePropertyReferences(version)).getFile();
return getArtifact(groupId, artifactId, type, version).getFile();
} catch (MojoExecutionException e) {
throw new PluginExecutionException(e);
}
Expand Down Expand Up @@ -146,10 +142,8 @@ protected Set<String> getDependencyFeatures() {
List<org.apache.maven.model.Dependency> dependencyArtifacts = project.getDependencies();
for (org.apache.maven.model.Dependency dependencyArtifact: dependencyArtifacts){
if (("esa").equals(dependencyArtifact.getType())) {
// Look for and replace maven props in the artifactId
String artifactId = resolvePropertyReferences(dependencyArtifact.getArtifactId());
result.add(artifactId);
getLog().debug("Dependency feature: " + artifactId);
result.add(dependencyArtifact.getArtifactId());
getLog().debug("Dependency feature: " + dependencyArtifact.getArtifactId());
}
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void error(String msg, Throwable e) {
@Override
public File downloadArtifact(String groupId, String artifactId, String type, String version) throws PluginExecutionException {
try {
// Look for and replace maven props in the coordinates
// Look for and replace maven props in the coordinates. This is necessary when called from
// PrepareFeatureUtil.downloadArtifactsFromBOM(File) because that bom file will not have been processed by maven.
return getArtifact(resolvePropertyReferences(groupId),
resolvePropertyReferences(artifactId),
type,
Expand Down

0 comments on commit 1883c1c

Please sign in to comment.