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


##########
.github/workflows/update-lifecycle-plugins.yml:
##########
@@ -0,0 +1,94 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Update lifecycle plugin versions
+
+on:
+  schedule:
+    # Every Monday at 08:00 UTC
+    - cron: '0 8 * * 1'
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+jobs:
+  update-lifecycle-plugins:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+      pull-requests: write
+    strategy:
+      fail-fast: false
+      matrix:
+        branch: [master, maven-4.0.x]
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: ${{ matrix.branch }}
+          persist-credentials: false
+
+      - uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # 
v6.0.1
+        with:
+          java-version: '21'
+          distribution: 'temurin'
+          cache: maven
+
+      - name: Update lifecycle plugin versions
+        run: |
+          mvn -B versions:update-properties \
+            -Pversions-update \
+            -DallowMajorUpdates=false \
+            
-DincludeProperties="version.maven-clean-plugin,version.maven-compiler-plugin,version.maven-deploy-plugin,version.maven-ear-plugin,version.maven-ejb-plugin,version.maven-install-plugin,version.maven-jar-plugin,version.maven-plugin-plugin,version.maven-rar-plugin,version.maven-resources-plugin,version.maven-site-plugin,version.maven-surefire-plugin,version.maven-war-plugin"
 \
+            -pl impl/maven-core
+
+      - name: Create Pull Request
+        env:
+          GH_TOKEN: ${{ github.token }}

Review Comment:
   ⚠️ **Regression — `github.token` reintroduced; PRs created by this workflow 
won't trigger CI.**
   
   Commit `8a29466e` correctly used `${{ secrets.GH_TOKEN }}` (a PAT that 
bypasses GitHub's restriction). This commit reverts to `${{ github.token }}`, 
which GitHub explicitly blocks from triggering downstream workflows on PRs it 
creates.
   
   ```suggestion
             GH_TOKEN: ${{ secrets.GH_TOKEN }}
   ```
   
   A `GH_TOKEN` org/repo secret must exist with the necessary `repo` scope. 
Without it, the automated update PRs will be created silently with no CI run, 
making the automation effectively useless for verifying the updates are safe.



##########
impl/maven-core/src/main/resources/org/apache/maven/lifecycle/plugin-versions.properties:
##########
@@ -20,16 +20,16 @@
 # POM properties (version.maven-<name>-plugin), making them visible to
 # dependency-update bots such as Dependabot and Renovate.
 
-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}
-version.maven-install-plugin=${version.maven-install-plugin}
-version.maven-jar-plugin=${version.maven-jar-plugin}
-version.maven-plugin-plugin=${version.maven-plugin-plugin}
-version.maven-rar-plugin=${version.maven-rar-plugin}
-version.maven-resources-plugin=${version.maven-resources-plugin}
-version.maven-site-plugin=${version.maven-site-plugin}
-version.maven-surefire-plugin=${version.maven-surefire-plugin}
-version.maven-war-plugin=${version.maven-war-plugin}
+lifecycle.clean-plugin=${lifecycle.clean-plugin}
+lifecycle.compiler-plugin=${lifecycle.compiler-plugin}
+lifecycle.deploy-plugin=${lifecycle.deploy-plugin}
+lifecycle.ear-plugin=${lifecycle.ear-plugin}
+lifecycle.ejb-plugin=${lifecycle.ejb-plugin}
+lifecycle.install-plugin=${lifecycle.install-plugin}
+lifecycle.jar-plugin=${lifecycle.jar-plugin}
+lifecycle.plugin-plugin=${lifecycle.plugin-plugin}
+lifecycle.rar-plugin=${lifecycle.rar-plugin}
+lifecycle.resources-plugin=${lifecycle.resources-plugin}
+lifecycle.site-plugin=${lifecycle.site-plugin}
+lifecycle.surefire-plugin=${lifecycle.surefire-plugin}
+lifecycle.war-plugin=${lifecycle.war-plugin}

Review Comment:
   🚨 **BUILD BREAK — placeholder-to-property name mismatch.**
   
   These filter placeholders reference `${lifecycle.clean-plugin}` etc., but 
`impl/maven-core/pom.xml` defines properties named `version.maven-clean-plugin` 
— the `lifecycle.*` property names do not exist anywhere in the POM hierarchy. 
Maven resource filtering will leave these as literal `${lifecycle.*}` strings, 
and `PluginVersions.java` will throw `ExceptionInInitializerError` at startup.
   
   Fix: keep the old placeholder form so that the existing 
`version.maven-*-plugin` properties resolve correctly:
   
   ```suggestion
   lifecycle.clean-plugin=${version.maven-clean-plugin}
   lifecycle.compiler-plugin=${version.maven-compiler-plugin}
   lifecycle.deploy-plugin=${version.maven-deploy-plugin}
   lifecycle.ear-plugin=${version.maven-ear-plugin}
   lifecycle.ejb-plugin=${version.maven-ejb-plugin}
   lifecycle.install-plugin=${version.maven-install-plugin}
   lifecycle.jar-plugin=${version.maven-jar-plugin}
   lifecycle.plugin-plugin=${version.maven-plugin-plugin}
   lifecycle.rar-plugin=${version.maven-rar-plugin}
   lifecycle.resources-plugin=${version.maven-resources-plugin}
   lifecycle.site-plugin=${version.maven-site-plugin}
   lifecycle.surefire-plugin=${version.maven-surefire-plugin}
   lifecycle.war-plugin=${version.maven-war-plugin}
   ```
   
   This keeps the `lifecycle.*` keys (matching what `PluginVersions.java` now 
looks up) but resolves them from the existing `version.maven-*-plugin` 
properties in `impl/maven-core/pom.xml`. No changes needed to `pom.xml` or the 
`versions-update` profile.



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