gnodet-bot commented on code in PR #13138:
URL: https://github.com/apache/maven/pull/13138#discussion_r4015122242


##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java:
##########
@@ -31,16 +33,16 @@ public final class MavenPluginLifecycleMappingProvider 
extends AbstractLifecycle
     // START SNIPPET: maven-plugin
     private static final String[] BINDINGS = {
         "process-resources",
-                "org.apache.maven.plugins:maven-resources-plugin:" + 
RESOURCES_PLUGIN_VERSION + ":resources",
-        "compile", "org.apache.maven.plugins:maven-compiler-plugin:" + 
COMPILER_PLUGIN_VERSION + ":compile",
-        "process-classes", "org.apache.maven.plugins:maven-plugin-plugin:" + 
PLUGIN_PLUGIN_VERSION + ":descriptor",
+                "org.apache.maven.plugins:maven-resources-plugin:" + 
PluginVersions.RESOURCES + ":resources",
+        "compile", "org.apache.maven.plugins:maven-compiler-plugin:" + 
PluginVersions.COMPILER + ":compile",
+        "process-classes", "org.apache.maven.plugins:maven-plugin-plugin:" + 
PluginVersions.PLUGIN + ":descriptor",
         "process-test-resources",
-                "org.apache.maven.plugins:maven-resources-plugin:" + 
RESOURCES_PLUGIN_VERSION + ":testResources",
-        "test-compile", "org.apache.maven.plugins:maven-compiler-plugin:" + 
COMPILER_PLUGIN_VERSION + ":testCompile",
-        "test", "org.apache.maven.plugins:maven-surefire-plugin:" + 
SUREFIRE_PLUGIN_VERSION + ":test",
-        "package", "org.apache.maven.plugins:maven-jar-plugin:" + 
JAR_PLUGIN_VERSION + ":jar,",
-        "install", "org.apache.maven.plugins:maven-install-plugin:" + 
INSTALL_PLUGIN_VERSION + ":install",
-        "deploy", "org.apache.maven.plugins:maven-deploy-plugin:" + 
DEPLOY_PLUGIN_VERSION + ":deploy"
+                "org.apache.maven.plugins:maven-resources-plugin:" + 
PluginVersions.RESOURCES + ":testResources",
+        "test-compile", "org.apache.maven.plugins:maven-compiler-plugin:" + 
PluginVersions.COMPILER + ":testCompile",
+        "test", "org.apache.maven.plugins:maven-surefire-plugin:" + 
PluginVersions.SUREFIRE + ":test",
+        "package", "org.apache.maven.plugins:maven-jar-plugin:" + 
PluginVersions.JAR + ":jar,",

Review Comment:
   ⚠️ **Pre-existing bug worth fixing here:** The trailing comma in `":jar,"` 
is a leftover from `MNG-8717` when the package phase used to bind two goals 
(`jar` + `addPluginArtifactMetadata`) in a single comma-separated string. 
`addPluginArtifactMetadata` was removed but the trailing comma remained.
   
   `LifecyclePhase` parses goals with `goals.split(",")`, which on 
`"g:a:v:jar,"` produces `["g:a:v:jar", ""]` — the empty string after trim 
becomes a `LifecycleMojo` with goal `""`. This is a silent no-op today (Maven 
skips blank goals internally), but it's dead weight that could produce 
confusing output or break a future assertion. Since this cleanup PR already 
touches `MavenPluginLifecycleMappingProvider`, this is the right time to drop 
it.
   
   ```suggestion
           "package", "org.apache.maven.plugins:maven-jar-plugin:" + 
PluginVersions.JAR + ":jar",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to