From 1883c1c9dbbc647770d7319e086fa92834d0d53a Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Mon, 27 Nov 2023 17:02:11 -0600 Subject: [PATCH] Remove unnecessary changes and add comment explaining logic --- .../tools/maven/AbstractLibertySupport.java | 2 +- .../tools/maven/InstallFeatureSupport.java | 12 +++--------- .../tools/maven/PrepareFeatureSupport.java | 3 ++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java index 1ac17e7e6..757286c37 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/AbstractLibertySupport.java @@ -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); diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java index 40fd9f93a..0e78d800f 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/InstallFeatureSupport.java @@ -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); } @@ -146,10 +142,8 @@ protected Set getDependencyFeatures() { List 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; diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java index a2e51c00a..a4ac003c5 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/PrepareFeatureSupport.java @@ -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,