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


##########
impl/maven-core/src/main/resources/org/apache/maven/lifecycle/plugin-versions.properties:
##########
@@ -17,19 +17,19 @@
 
 # Default lifecycle plugin versions.
 # Values are substituted by Maven resource filtering at build time from
-# POM properties (lifecycle.<name>-plugin), making them visible to
+# POM properties (version.maven-<name>-plugin), making them visible to
 # dependency-update bots such as Dependabot and Renovate.
 
-lifecycle.maven-clean-plugin=${lifecycle.maven-clean-plugin}
-lifecycle.maven-compiler-plugin=${lifecycle.maven-compiler-plugin}
-lifecycle.maven-deploy-plugin=${lifecycle.maven-deploy-plugin}
-lifecycle.maven-ear-plugin=${lifecycle.maven-ear-plugin}
-lifecycle.maven-ejb-plugin=${lifecycle.maven-ejb-plugin}
-lifecycle.maven-install-plugin=${lifecycle.maven-install-plugin}
-lifecycle.maven-jar-plugin=${lifecycle.maven-jar-plugin}
-lifecycle.maven-plugin-plugin=${lifecycle.maven-plugin-plugin}
-lifecycle.maven-rar-plugin=${lifecycle.maven-rar-plugin}
-lifecycle.maven-resources-plugin=${lifecycle.maven-resources-plugin}
-lifecycle.maven-site-plugin=${lifecycle.maven-site-plugin}
-lifecycle.maven-surefire-plugin=${lifecycle.maven-surefire-plugin}
-lifecycle.maven-war-plugin=${lifecycle.maven-war-plugin}
+version.maven-clean-plugin=${version.maven-clean-plugin}
+version.maven-compiler-plugin=${version.maven-compiler-plugin}
+version.maven-deploy-plugin=${version.maven-deploy-plugin}
+version.maven-ear-plugin=${version.maven-ear-plugin}
+version.maven-ejb-plugin=${version.maven-ejb-plugin}

Review Comment:
   **[high] Property key mismatch — filtering placeholder will never be 
substituted, breaking 100+ lifecycle tests**
   
   This file now uses `version.maven-*-plugin` placeholders (e.g. 
`${version.maven-ejb-plugin}` on this line), but `impl/maven-core/pom.xml` 
still defines the properties as 
`<lifecycle.maven-ejb-plugin>3.3.0</lifecycle.maven-ejb-plugin>` (new file line 
43). Maven resource filtering can only substitute a placeholder if the property 
name in the POM **exactly** matches the `${...}` expression in the template.
   
   Because there is no `<version.maven-ejb-plugin>` property in the POM, the 
placeholder survives filtering as a literal string. `PluginVersions.java` then 
reads `version.maven-ejb-plugin=\${version.maven-ejb-plugin}` and throws:
   
   ```
   ExceptionInInitializerError: plugin-versions.properties was not filtered at 
build time;
   version.maven-ejb-plugin still contains placeholder: 
${version.maven-ejb-plugin}
   ```
   
   CI confirms: every test that touches `PluginVersions` fails with this error 
(LifecycleExecutorTest, BuildPlanCreatorTest, etc.).
   
   **Root cause:** The squash-rebase onto master picked up commit `ab8947053d` 
(`chore: add versions:update-properties workflow`) which renamed the POM 
properties from `version.*` → `lifecycle.*`. This PR simultaneously reverts 
those POM names back to `lifecycle.*` (bumped versions from master) but also 
changes `plugin-versions.properties` and `PluginVersions.java` to use 
`version.*` — leaving the three files inconsistent.
   
   **Fix:** In `impl/maven-core/pom.xml`, rename all 13 
`<lifecycle.maven-*-plugin>` properties to `<version.maven-*-plugin>` (keeping 
the updated version numbers from master):
   
   ```suggestion
   version.maven-ejb-plugin=${version.maven-ejb-plugin}
   ```



##########
impl/maven-core/pom.xml:
##########
@@ -36,19 +36,19 @@ under the License.
          Maintained here so that dependency-update bots (Dependabot, Renovate)
          can propose version bumps automatically.  Values are filtered into
          plugin-versions.properties at build time and loaded at runtime. -->
-    <lifecycle.maven-clean-plugin>3.4.0</lifecycle.maven-clean-plugin>
-    <lifecycle.maven-compiler-plugin>3.13.0</lifecycle.maven-compiler-plugin>
-    <lifecycle.maven-deploy-plugin>3.1.3</lifecycle.maven-deploy-plugin>
-    <lifecycle.maven-ear-plugin>3.3.0</lifecycle.maven-ear-plugin>
-    <lifecycle.maven-ejb-plugin>3.2.1</lifecycle.maven-ejb-plugin>
-    <lifecycle.maven-install-plugin>3.1.3</lifecycle.maven-install-plugin>
-    <lifecycle.maven-jar-plugin>3.4.2</lifecycle.maven-jar-plugin>
-    <lifecycle.maven-plugin-plugin>3.15.1</lifecycle.maven-plugin-plugin>
-    <lifecycle.maven-rar-plugin>3.0.0</lifecycle.maven-rar-plugin>
-    <lifecycle.maven-resources-plugin>3.3.1</lifecycle.maven-resources-plugin>
-    <lifecycle.maven-site-plugin>3.21.0</lifecycle.maven-site-plugin>
-    <lifecycle.maven-surefire-plugin>3.5.2</lifecycle.maven-surefire-plugin>
-    <lifecycle.maven-war-plugin>3.4.0</lifecycle.maven-war-plugin>
+    <lifecycle.maven-clean-plugin>3.5.0</lifecycle.maven-clean-plugin>
+    <lifecycle.maven-compiler-plugin>3.16.0</lifecycle.maven-compiler-plugin>
+    <lifecycle.maven-deploy-plugin>3.2.0</lifecycle.maven-deploy-plugin>
+    <lifecycle.maven-ear-plugin>3.4.0</lifecycle.maven-ear-plugin>
+    <lifecycle.maven-ejb-plugin>3.3.0</lifecycle.maven-ejb-plugin>
+    <lifecycle.maven-install-plugin>3.2.0</lifecycle.maven-install-plugin>
+    <lifecycle.maven-jar-plugin>3.5.1</lifecycle.maven-jar-plugin>
+    <lifecycle.maven-plugin-plugin>3.16.0</lifecycle.maven-plugin-plugin>
+    <lifecycle.maven-rar-plugin>3.1.0</lifecycle.maven-rar-plugin>
+    <lifecycle.maven-resources-plugin>3.5.0</lifecycle.maven-resources-plugin>
+    <lifecycle.maven-site-plugin>3.22.0</lifecycle.maven-site-plugin>
+    <lifecycle.maven-surefire-plugin>3.6.0</lifecycle.maven-surefire-plugin>
+    <lifecycle.maven-war-plugin>3.5.1</lifecycle.maven-war-plugin>

Review Comment:
   **[high] POM property names must match `plugin-versions.properties` 
placeholders**
   
   This block defines `<lifecycle.maven-*-plugin>` properties, but 
`plugin-versions.properties` (changed in this same PR) uses 
`${version.maven-*-plugin}` placeholders. Maven resource filtering looks up 
properties by exact name — these never match, so all 13 placeholders survive 
unresolved.
   
   Rename all 13 properties here from `lifecycle.*` to `version.*` to align 
with the new `plugin-versions.properties` and `PluginVersions.java`:
   
   ```suggestion
       <version.maven-clean-plugin>3.5.0</version.maven-clean-plugin>
       <version.maven-compiler-plugin>3.16.0</version.maven-compiler-plugin>
       <version.maven-deploy-plugin>3.2.0</version.maven-deploy-plugin>
       <version.maven-ear-plugin>3.4.0</version.maven-ear-plugin>
       <version.maven-ejb-plugin>3.3.0</version.maven-ejb-plugin>
       <version.maven-install-plugin>3.2.0</version.maven-install-plugin>
       <version.maven-jar-plugin>3.5.1</version.maven-jar-plugin>
       <version.maven-plugin-plugin>3.16.0</version.maven-plugin-plugin>
       <version.maven-rar-plugin>3.1.0</version.maven-rar-plugin>
       <version.maven-resources-plugin>3.5.0</version.maven-resources-plugin>
       <version.maven-site-plugin>3.22.0</version.maven-site-plugin>
       <version.maven-surefire-plugin>3.6.0</version.maven-surefire-plugin>
       <version.maven-war-plugin>3.5.1</version.maven-war-plugin>
   ```
   
   Also update the `pluginManagement` comment on line 284 (currently says 
`lifecycle.maven-*-plugin`) to say `version.maven-*-plugin` for consistency.



-- 
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