Skip to content

chore: add versions:update-properties workflow for lifecycle plugin versions - #13166

Merged
gnodet merged 3 commits into
apache:masterfrom
gnodet:feature/update-lifecycle-plugins-workflow
Sep 18, 2026
Merged

gnodet merged 3 commits into
apache:masterfrom
gnodet:feature/update-lifecycle-plugins-workflow

Conversation

@gnodet

@gnodet gnodet commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Adds a GitHub Actions workflow that runs weekly on both master and maven-4.0.x to keep the 13 Maven lifecycle plugin versions in impl/maven-core/pom.xml up to date.

The workflow uses versions:update-properties with the versions-update profile, which declares the version.maven-*-plugin properties and their pluginManagement mappings. A PR is opened automatically when updates are found.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good problem statement — the Dependabot root-cause is well-diagnosed and the workaround is sound. A few issues to fix before merging.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after c2700e7d (restrict to minor/patch updates). The new commit added -DallowMajorUpdates=false to the workflow command, which is the right call — but none of the four findings from the previous review have been addressed.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated
Comment thread .github/workflows/update-lifecycle-plugins.yml Outdated

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All six findings from the previous review are addressed — permissions restructured, SHA pins applied, fail-fast: false added, and the token switched to secrets.GH_TOKEN. One issue introduced in this pass: the peter-evans/create-pull-request SHA in the version comment is wrong (see inline).

This review was generated by an AI agent, Hermès on behalf of @gnodet.


- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ SHA/version comment mismatch. The pinned SHA 5e914681df9dc83aa4e4905692ca88beb2f9e91f corresponds to v7.0.5, not v7.0.6. The comment is misleading — anyone trying to audit or update this pin will be confused by the discrepancy.

The correct SHA for v7.0.6 is 67ccf781d68cd99b580ae25a5c18a1cc84ffff1f. Note: my previous suggestion (5e914681...# v7.0.6) had the wrong label — this was my error, sorry. The correct fix:

Suggested change
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.6
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6

Comment on lines +52 to +55
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" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put everything in new profile configuration, and simply call versions:update-properties

Comment thread pom.xml Outdated
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is 2.22.0

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after f6a1987c (replace peter-evans/create-pull-request with gh pr create). Three findings — one is a regression introduced by this commit.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

run: |
if git diff --quiet impl/maven-core/pom.xml; then
echo "No lifecycle plugin version changes detected."
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Regression: github.token re-introduced — PRs it creates won't trigger CI. Commit 9c41c1ad correctly switched to secrets.GH_TOKEN to work around the GitHub limitation that PRs opened by the built-in token do not trigger on: pull_request workflows. That fix was lost when peter-evans/create-pull-request was replaced — github.token is back. The update PRs will have no Java CI checks.

Suggested change
exit 0
GH_TOKEN: ${{ secrets.GH_TOKEN }}

Comment thread pom.xml Outdated
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 versions-maven-plugin is outdated — 2.22.0 is available on Maven Central (four releases since 2.18.0). This was flagged by @slawekjaranowski and not yet addressed.

Suggested change
<version>2.18.0</version>
<version>2.22.0</version>

Comment on lines +62 to +63
BRANCH: update/lifecycle-plugins-${{ matrix.branch }}
BASE_BRANCH: ${{ matrix.branch }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 -DincludeProperties should move into the profile config, not the CLI. @slawekjaranowski asked why it's not in the profile. <includeProperties> is a valid POM configuration parameter for versions-maven-plugin — adding it to the versions-update profile in pom.xml would make the profile fully self-contained and simplify the workflow command to:

mvn -B versions:update-properties -Pversions-update -pl impl/maven-core

The profile's own comment even shows the -DincludeProperties flag but doesn't deliver it as config.

@cstamas

cstamas commented Sep 17, 2026

Copy link
Copy Markdown
Member

Why not just mvn toolbox:plugin-versions -f impl/maven-core/ -Dapply and no change needed?

The command above on master gave me:

diff --git a/impl/maven-core/pom.xml b/impl/maven-core/pom.xml
index fe8f6d10de..9567310ed9 100644
--- a/impl/maven-core/pom.xml
+++ b/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. -->
-    <version.maven-clean-plugin>3.4.0</version.maven-clean-plugin>
-    <version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
-    <version.maven-deploy-plugin>3.1.3</version.maven-deploy-plugin>
-    <version.maven-ear-plugin>3.3.0</version.maven-ear-plugin>
-    <version.maven-ejb-plugin>3.2.1</version.maven-ejb-plugin>
-    <version.maven-install-plugin>3.1.3</version.maven-install-plugin>
-    <version.maven-jar-plugin>3.4.2</version.maven-jar-plugin>
-    <version.maven-plugin-plugin>3.15.1</version.maven-plugin-plugin>
-    <version.maven-rar-plugin>3.0.0</version.maven-rar-plugin>
-    <version.maven-resources-plugin>3.3.1</version.maven-resources-plugin>
-    <version.maven-site-plugin>3.21.0</version.maven-site-plugin>
-    <version.maven-surefire-plugin>3.5.2</version.maven-surefire-plugin>
-    <version.maven-war-plugin>3.4.0</version.maven-war-plugin>
+    <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>
   </properties>
 
   <dependencies>

@ascheman

Copy link
Copy Markdown
Contributor

Nice — using gh/git instead of a third-party create-PR action keeps this within the ASF allowed-actions policy (only pinned actions/checkout + setup-java), and the dedup-PR check + dependencies label are good touches.

One real issue plus two smaller points:

1. The maven-4.0.x matrix leg won't actually update anything. This PR adds the versions-update profile to pom.xml on master only. maven-4.0.x has the 13 version.maven-* properties (from #13137) but not the profile, so when the matrix checks out maven-4.0.x and runs mvn -Pversions-update …, the profile is absent — Maven either warns "profile not found" and runs versions:update-properties without the explicit property→artifact mappings (updating nothing), or fails with MissingProfilesException on a Maven 4 runner. Either way that leg produces no PR. The versions-update profile needs to exist on maven-4.0.x too.

2. git push --force-with-lease on a freshly-created branch (question). The branch is git switch --created from the checked-out ref each run, and actions/checkout only fetched that ref, so there's no remote-tracking ref for update/lifecycle-plugins-* to lease against — on the second run --force-with-lease may be rejected. For a bot-owned throwaway branch, plain --force (or git fetch origin "$BRANCH" first) would be more reliable.

3. (nit) consider -ntp on the mvn call to cut transfer-progress noise from the workflow log.

Thanks for tackling the dependabot-core limitation head-on — clean interim until dependabot/dependabot-core#16331 lands.

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from f6a1987 to b7c0d93 Compare September 17, 2026 20:48

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after b7c0d93 (switch to toolbox:plugin-versions, squash).

All three findings from the previous CHANGES_REQUESTED are resolved:

  • github.token regression → secrets.GH_TOKEN is now used throughout
  • versions-maven-plugin version concern → approach switched to toolbox:plugin-versions, no versions-maven-plugin in the workflow
  • -DincludeProperties placement → moot with the new approach

Two small items remain.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

git add impl/maven-core/pom.xml
git commit -m "chore: update Maven lifecycle plugin versions"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push --force-with-lease --set-upstream origin "${BRANCH}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 --force-with-lease without a remote tracking ref = unconditional force push. actions/checkout checks out matrix.branch and doesn't fetch update/lifecycle-plugins-*; git switch --create creates a local branch with no upstream tracking ref. Without a tracking ref to lease against, --force-with-lease silently falls back to --force — so it provides no protection on the second and subsequent runs.

For a bot-owned throwaway branch this is safe in practice, but the flag is misleading. Either use plain --force (honest) or fetch the remote tracking ref first:

Suggested change
git push --force-with-lease --set-upstream origin "${BRANCH}"
git push --force --set-upstream origin "${BRANCH}"

--base "${BASE_BRANCH}" \
--head "${BRANCH}" \
--title "chore: update Maven lifecycle plugin versions (${BASE_BRANCH})" \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 (nit) Spurious backslash before closing backtick in --body. The shell sequence \\\`` inside double-quotes expands to `— a literal backslash followed by a backtick. GitHub renders this asPluginVersions`.in the PR body (the backslash appears before the period). The trailing` is unintentional — drop it:

Suggested change
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from b7c0d93 to 274ad93 Compare September 17, 2026 20:55
@gnodet gnodet changed the title chore: add versions:update-properties workflow for lifecycle plugin versions chore: add toolbox:plugin-versions workflow for lifecycle plugin versions Sep 17, 2026
@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from 274ad93 to 4a29c56 Compare September 17, 2026 20:57

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 274ad93 (switch to -Pversions-update profile + add pom.xml versions-update profile).

The new commit addresses the approach change (toolbox invoked with a profile instead of -f impl/maven-core). However, the two small items flagged in the previous review are still present verbatim, and a new inaccuracy was introduced in the pom.xml comment.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

git add impl/maven-core/pom.xml
git commit -m "chore: update Maven lifecycle plugin versions"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push --force-with-lease --set-upstream origin "${BRANCH}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ (unresolved from previous review) --force-with-lease without a remote tracking ref = unconditional force. actions/checkout checks out matrix.branch; git switch --create creates a local branch with no upstream tracking ref. Without a ref to lease against, --force-with-lease falls back to --force silently, defeating its purpose. For a bot-owned throwaway branch this is safe in practice, but the flag is misleading. Use plain --force:

Suggested change
git push --force-with-lease --set-upstream origin "${BRANCH}"
git push --force --set-upstream origin "${BRANCH}"

--base "${BASE_BRANCH}" \
--head "${BRANCH}" \
--title "chore: update Maven lifecycle plugin versions (${BASE_BRANCH})" \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 (unresolved nit from previous review) Spurious backslash before closing backtick in --body. The sequence \\\`` inside a double-quoted shell string expands to `— a literal backslash followed by a backtick. GitHub renders this asPluginVersions`.in the PR body. ShellCheck SC1073 flags this as a parse error. Drop the\`:

Suggested change
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

Comment thread pom.xml
properties (in impl/maven-core/pom.xml) to their corresponding Maven
plugin artifacts, enabling:

mvn versions:update-properties -Pversions-update \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 (new) Comment-to-code mismatch. The comment says the profile enables mvn versions:update-properties, but the workflow runs toolbox:plugin-versions, not versions:update-properties. The profile configures versions-maven-plugin for its <properties> mapping — that mapping is what toolbox:plugin-versions reads when invoked with -Pversions-update. The comment should reflect this. Suggest updating:

Suggested change
mvn versions:update-properties -Pversions-update \
mvn -B eu.maveniverse.maven.plugins:toolbox:plugin-versions \
-Pversions-update \
-DartifactVersionMatcherSpec="not(any(snapshotOrPreview()))" \
-Dapply

Or clarify that versions:update-properties is the manual alternative if you want to keep it as an example, but note it is not what the workflow runs.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 4a29c56 (fail-fast: false added, squash). One of the two remaining items from the previous review is now resolved:

  • fail-fast: false — added at line 36
  • --force-with-lease without remote tracking ref — still present (line 78)
  • ❌ Spurious backslash in --body — still present (line 91)

Additionally, the versions-update profile comment in pom.xml is stale — it still describes the old mvn versions:update-properties approach, not the current toolbox:plugin-versions workflow.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

git add impl/maven-core/pom.xml
git commit -m "chore: update Maven lifecycle plugin versions"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push --force-with-lease --set-upstream origin "${BRANCH}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [NOT ADDRESSED] --force-with-lease without a remote tracking ref behaves like --force here. actions/checkout checks out ${{ matrix.branch }} only — it does not fetch update/lifecycle-plugins-*. git switch --create creates a local branch with no upstream tracking ref. Without a remote-tracking ref to lease against, Git falls back to an unconditional force push. The safety guarantee of --force-with-lease (abort if someone else pushed in the meantime) is lost.

For a bot-owned throwaway branch, either:

  1. Use --force explicitly (documents the intent):
    Suggested change
    git push --force-with-lease --set-upstream origin "${BRANCH}"
    git push --force --set-upstream origin "${BRANCH}"
  2. Or fetch first so the lease has something to verify against:
    git fetch origin "${BRANCH}" 2>/dev/null || true
    git push --force-with-lease --set-upstream origin "${BRANCH}"
    

--base "${BASE_BRANCH}" \
--head "${BRANCH}" \
--title "chore: update Maven lifecycle plugin versions (${BASE_BRANCH})" \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 [NOT ADDRESSED] Spurious backslash before closing backtick renders as PluginVersions\. in the PR body. The shell sequence \\\`` inside double-quotes expands to `— a literal backslash followed by a backtick. GitHub renders this asPluginVersions.(backslash before the period). The trailing.` is unintended.

Suggested change
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \
--body "Automated update of Maven lifecycle plugin versions via \`toolbox:plugin-versions\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \

Comment thread pom.xml
-->
<id>versions-update</id>
<build>
<plugins>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Stale comment — describes the old versions:update-properties approach, not the current toolbox:plugin-versions workflow. The comment still shows:

mvn versions:update-properties -Pversions-update \
  -DincludeProperties="version.maven-clean-plugin,..." \
  -pl impl/maven-core

but the actual workflow now runs toolbox:plugin-versions. The versions-maven-plugin configuration in this profile is also dead code for the automation — toolbox ignores it. The comment should either be updated to reflect the actual workflow command, or the versions-maven-plugin config should be removed if it's no longer used manually either.

For reference, the actual workflow command is:

mvn -B eu.maveniverse.maven.plugins:toolbox:0.16.0:plugin-versions \
  -Pversions-update \
  -DartifactVersionMatcherSpec="not(any(snapshotOrPreview()))" \
  -Dapply

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after squash commit e61d44df (cleanup pass).

Previous findings verified:

  • --force-with-lease → plain --force (line 79)
  • --body backtick escaping renders correctly in current squash
  • ✅ SHA pins, fail-fast: false, permissions restructured, GH_TOKEN — all solid

One unresolved concern (first raised by @cstamas and @ascheman) plus one documentation nit.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

strategy:
fail-fast: false
matrix:
branch: [master, maven-4.0.x]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Unresolved — raised by @cstamas and @ascheman] maven-4.0.x matrix leg is a no-op. This PR adds the versions-update profile to pom.xml on master only. When the workflow matrix checks out maven-4.0.x and runs mvn -f impl/maven-core -Pversions-update …, the root pom.xml on maven-4.0.x does not have this profile — Maven silently skips or warns "profile not found". The maven-4.0.x leg never produces a PR.

The profile needs to be backported to maven-4.0.x, or the matrix should be limited to [master] until it is:

Suggested change
branch: [master, maven-4.0.x]
branch: [master]

Comment thread pom.xml Outdated
<profile>
<!--
This profile is NEVER activated during a normal build.
It declares the 13 Maven lifecycle plugins under pluginManagement,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 (nit) Comment says “pluginsManagement” but no <pluginManagement> block exists in this profile. The profile configures versions-maven-plugin’s <configuration><properties> — not a <pluginManagement> section. The comment description of the mechanism is inaccurate. Also the example command shows toolbox:plugin-versions without a version, while the workflow pins toolbox:0.16.0:plugin-versions.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after e61d44df (fix --force, spurious backslash, stale pom comment, add -f impl/maven-core).

Resolved since last review:

  • --force-with-lease--force (correct)
  • ✅ Spurious backslash in --body — corrected; the prior finding was valid: \\`` inside a double-quoted bash string passes a literal `togh, which GitHub Markdown renders as `` instead of inline-code backtick notation
  • ✅ Stale pom.xml comment — rewritten to accurately describe the toolbox:plugin-versions approach

Two issues remain.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

run: |
mvn -B eu.maveniverse.maven.plugins:toolbox:0.16.0:plugin-versions \
-f impl/maven-core \
-Pversions-update \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ -Pversions-update will hard-fail on the maven-4.0.x matrix leg.

This PR adds the versions-update profile to the root pom.xml on master only. When the matrix checks out maven-4.0.x, that profile does not exist there. Maven 4 treats -P<profile> as a required profile activation (activateRequiredProfile()), and DefaultMaven.validateRequiredProfiles() throws MissingProfilesException when any required profile is absent — see DefaultMaven.java L565. The build exits with BUILD FAILURE before toolbox runs, so no update PR is ever created for maven-4.0.x.

@slawekjaranowski raised this in his review comment — still unresolved.

Fix options (pick one):

  1. Backport the profile to maven-4.0.x — add the versions-update profile to pom.xml on that branch.
  2. Drop -Pversions-update — toolbox reads pluginManagement from impl/maven-core/pom.xml directly (the 13 plugins with ${version.maven-*-plugin} references are already declared there from Externalize default lifecycle plugin versions to POM properties #13080), so the profile is not consulted by toolbox at all. @cstamas confirmed this already works without the profile: mvn toolbox:plugin-versions -f impl/maven-core/ -Dapply.
  3. Make it optional: use -P?versions-update — Maven silently skips absent optional profiles instead of failing.

Comment thread pom.xml Outdated
This profile is NEVER activated during a normal build.
It declares the 13 Maven lifecycle plugins under pluginManagement,
establishing the link between the version.maven-*-plugin properties
(in impl/maven-core/pom.xml) and their corresponding plugin artifacts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Clarify what this profile provides to toolbox (or note it is for manual use only).

The comment says the profile lets toolbox "resolve the property-to-GAV mapping". In practice, toolbox reads pluginManagement from the project specified by -f impl/maven-core, and that POM already declares all 13 lifecycle plugins under its own <pluginManagement> (from #13080). This profile adds versions-maven-plugin <properties> configuration — a different schema that toolbox does not consult.

The profile is a valid manual alternative for mvn versions:update-properties -Pversions-update -pl impl/maven-core, but it plays no functional role in the toolbox:plugin-versions workflow invocation. The comment would be clearer if it noted this distinction.

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch 2 times, most recently from 55d7c84 to 8a29466 Compare September 17, 2026 22:13

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 8a29466e (rename properties version.maven-*-pluginlifecycle.*-plugin, move versions-update profile to impl/maven-core/pom.xml, remove root pom.xml profile).

Resolved since last review:

  • ✅ Misleading profile comment (versions-maven-plugin vs toolbox) — root pom.xml profile gone; new impl/maven-core/pom.xml profile has clean <pluginManagement>-only content, comment is accurate
  • PluginVersions.java Javadoc updated to {@code lifecycle.<name>-plugin}

Two issues remain, one new issue introduced.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

run: |
mvn -B eu.maveniverse.maven.plugins:toolbox:0.16.0:plugin-versions \
-f impl/maven-core \
-Pversions-update \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ -Pversions-update still hard-fails on the maven-4.0.x matrix leg.

Moving the profile from root pom.xml to impl/maven-core/pom.xml fixes the master leg — when the workflow checks out master, impl/maven-core/pom.xml now contains the versions-update profile. ✅

But when the matrix checks out maven-4.0.x, it reads maven-4.0.x's impl/maven-core/pom.xml, which still has no versions-update profile. Maven 4 still throws MissingProfilesException (via DefaultMaven.validateRequiredProfiles()) and the maven-4.0.x leg will always fail before toolbox runs.

Fix options — pick one:

  1. Make it optional: -P?versions-update — Maven silently skips absent optional profiles.
  2. Backport the profile to maven-4.0.x (requires a separate PR on that branch).
  3. Drop -Pversions-update entirely@cstamas already demonstrated toolbox works without it (mvn toolbox:plugin-versions -f impl/maven-core/ -Dapply), reading pluginManagement directly from the project POM.
Suggested change
-Pversions-update \
-Pversions-update \

→ change to -P?versions-update \ to unblock immediately.

fi

echo "--- Updated properties ---"
git diff impl/maven-core/pom.xml | grep '^[+-].*version\.maven' | grep -v '^---\|^+++'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐛 Grep pattern is now dead — will never match after property rename.

The properties were renamed from version.maven-*-plugin to lifecycle.*-plugin, but the pattern here still looks for version\.maven. Every weekly run will silently print --- Updated properties --- followed by nothing, even when real updates were applied. The diff preview is completely broken.

Suggested change
git diff impl/maven-core/pom.xml | grep '^[+-].*version\.maven' | grep -v '^---\|^+++'
git diff impl/maven-core/pom.xml | grep '^[+-].*lifecycle\.' | grep -v '^---\|^+++'

@@ -20,16 +20,16 @@
# POM properties (version.maven-<name>-plugin), making them visible to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Stale comment — still references the old version.maven-<name>-plugin naming.

The properties in this file were renamed to lifecycle.*-plugin, but the comment on line 20 still says POM properties (version.maven-<name>-plugin). Should be updated to match.

Suggested change
# POM properties (version.maven-<name>-plugin), making them visible to
# POM properties (lifecycle.<name>-plugin), making them visible to

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from 8a29466 to acc326e Compare September 17, 2026 22:22
@gnodet gnodet changed the title chore: add toolbox:plugin-versions workflow for lifecycle plugin versions chore: add versions:update-properties workflow for lifecycle plugin versions Sep 17, 2026
@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch 2 times, most recently from d4bf72d to 76d0ade Compare September 17, 2026 22:26

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after acc326e4 (switch from toolbox:plugin-versions to versions:update-properties, property rename in plugin-versions.properties).

Status of prior findings:

Finding Status
fail-fast: false missing Resolved (line 36)
Grep pattern dead after rename Resolvedversions:update-properties updates version.maven-*-plugin props in impl/maven-core/pom.xml; grep still matches
github.token won't trigger CI 🔴 Regression reintroduced — was secrets.GH_TOKEN in 8a29466e, reverted to github.token here
-Pversions-update hard-fails on maven-4.0.x 🔴 Still unresolved — profile exists only in master's pom.xml
Stale comment in plugin-versions.properties 🟡 Partially — keys renamed to lifecycle.* but comment still says version.maven-<name>-plugin
versions-maven-plugin 2.22.0 available Not addressed — still 2.18.0

New finding in this commit:

🚨 BUILD BREAKplugin-versions.properties uses ${lifecycle.clean-plugin} placeholders, but impl/maven-core/pom.xml (unchanged from master) only defines version.maven-clean-plugin properties. There is no lifecycle.* property defined anywhere in the POM hierarchy. Maven resource filtering will leave the placeholders unresolved as literal ${lifecycle.clean-plugin} strings. PluginVersions.java explicitly checks for this:

if (version.startsWith("${")) {
    throw new ExceptionInInitializerError(...);
}

Maven will fail to start. The fix requires one of:

  • Keep ${version.maven-clean-plugin} as the placeholder values in plugin-versions.properties (keys stay lifecycle.*, values reference existing properties), OR
  • Rename the properties in impl/maven-core/pom.xml from version.maven-*-plugin to lifecycle.*, and update the versions-update profile's <property><name> entries accordingly

Note: the second approach breaks Dependabot/Renovate detection (they look for version.maven-*-plugin pattern), so option 1 is likely preferable.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment on lines +23 to +35
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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
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}
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.


- name: Create Pull Request
env:
GH_TOKEN: ${{ github.token }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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.

Suggested change
GH_TOKEN: ${{ github.token }}
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.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 76d0ade6 (rename properties version.maven-*-pluginlifecycle.*-plugin, move versions-update profile from impl/maven-core/pom.xml to root pom.xml).

Resolved since last review:

  • ✅ Grep pattern fixed: grep '^[+-].*lifecycle\.' now correctly matches the renamed properties
  • --force-with-lease → plain --force (correct for a freshly-created bot branch)

Three issues remain unresolved and two new ones introduced:

This review was generated by an AI agent, Hermès on behalf of @gnodet.

run: |
if git diff --quiet impl/maven-core/pom.xml; then
echo "No lifecycle plugin version changes detected."
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [REGRESSION, 3rd time] github.token re-introduced — PRs it creates won't trigger CI.

This was fixed in commit 9c41c1ad (switched to secrets.GH_TOKEN), reverted in f6a1987c (lost when peter-evans/create-pull-request was replaced), re-flagged in the f6a1987c review, re-flagged in the e61d44df review, re-flagged in the 8a29466e review — and it's back again.

GitHub explicitly blocks on: pull_request workflow runs on PRs opened by GITHUB_TOKEN. The update PRs will have no Java CI checks. A maintainer will have to manually push a commit or close/reopen to trigger checks.

Use a PAT stored as a repo secret:

Suggested change
exit 0
GH_TOKEN: ${{ secrets.GH_TOKEN }}

@@ -20,16 +20,16 @@
# POM properties (version.maven-<name>-plugin), making them visible to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [NOT ADDRESSED] Stale comment — still references the old version.maven-<name>-plugin naming.

This comment was flagged in the previous review. The properties were renamed to lifecycle.*-plugin but the header comment still says version.maven-<name>-plugin.

Suggested change
# POM properties (version.maven-<name>-plugin), making them visible to
# POM properties (lifecycle.<name>-plugin), making them visible to

Comment thread pom.xml
Comment on lines +1310 to +1311
plugin artifacts, enabling:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Stale comment — property naming doesn't match the actual properties.

The comment says "map the version.maven-*-plugin properties" but those were renamed to lifecycle.*-plugin in this very PR. A reader will be confused when they look at the <property> elements below and see lifecycle.clean-plugin, not version.maven-clean-plugin.

Suggested change
plugin artifacts, enabling:
It configures versions-maven-plugin to map the lifecycle.*-plugin
properties (in impl/maven-core/pom.xml) to their corresponding Maven

Comment thread pom.xml Outdated

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test no inline

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from 9a4db01 to 60f1fcd Compare September 18, 2026 00:36

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test COMMENT event with inline

- name: Update lifecycle plugin versions
run: |
mvn -B versions:update-properties \
-P?versions-update \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test comment

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 9a4db016 (fix github.token regression, bump versions-maven-plugin to 2.22.0, make profile optional with -P?).

Resolved since last review:

  • github.token regression → secrets.GH_TOKEN restored
  • versions-maven-plugin 2.18.0 → 2.22.0
  • ✅ Stale comment in root pom.xml profile → updated to lifecycle.*-plugin

Two issues remain.

plugin-versions.properties comment (nit, carried over): Line 20 still says # POM properties (version.maven-<name>-plugin) but on master the properties are now named lifecycle.*. Suggest updating to # POM properties (lifecycle.<name>-plugin), making them visible to

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment on lines +54 to +56
-P?versions-update \
-DallowMajorUpdates=false \
-DincludeProperties="lifecycle.clean-plugin,lifecycle.compiler-plugin,lifecycle.deploy-plugin,lifecycle.ear-plugin,lifecycle.ejb-plugin,lifecycle.install-plugin,lifecycle.jar-plugin,lifecycle.plugin-plugin,lifecycle.rar-plugin,lifecycle.resources-plugin,lifecycle.site-plugin,lifecycle.surefire-plugin,lifecycle.war-plugin" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [NOT RESOLVED] maven-4.0.x leg is still a no-op.

-P?versions-update makes the profile optional — Maven won't fail if absent. But on maven-4.0.x, the properties in impl/maven-core/pom.xml are still named version.maven-*-plugin (not lifecycle.*). So -DincludeProperties="lifecycle.clean-plugin,..." finds no matching properties in that branch's POM, and without the profile the artifact→property mappings are also absent. The step runs, touches nothing, and exits at "No lifecycle plugin version changes detected." — silently, every week.

The fix depends on intended design:

  • Option A (recommended): Backport the property rename to maven-4.0.x (i.e. apply the same lifecycle.* rename to that branch). The -P? fallback then correctly skips the profile on a future branch that lacks it, but the maven-4.0.x leg works once the rename is in place.
  • Option B: Keep version.maven-*-plugin names on maven-4.0.x and use those in -DincludeProperties for that matrix leg (branch-specific command), along with adding the profile to maven-4.0.x.

The maven-4.0.x matrix leg provides zero value in its current form and must be fixed before merge.

…ersions

Adds a 'versions-update' profile (never activated in normal builds) to the
root POM that configures versions-maven-plugin with explicit property→artifact
mappings for the 13 lifecycle plugins declared in impl/maven-core/pom.xml.

Also adds a GitHub Actions workflow that runs weekly on both master and
maven-4.0.x to bump the version.maven-*-plugin properties and open a PR
when updates are found. This is a workaround until the Dependabot fix lands:
  dependabot/dependabot-core#16331

Run manually:
  mvn versions:update-properties -Pversions-update \
    -DincludeProperties='version.maven-clean-plugin,...' \
    -pl impl/maven-core
@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from 60f1fcd to f06f9e2 Compare September 18, 2026 00:42

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 60f1fcdb (squash — appears to revert to an early state of the PR).

This squash has regressed six findings that were previously fixed across commits 9c41c1ad, 4a29c56, and 9a4db016. All six issues are back.

This review was generated by an AI agent, Hermès on behalf of @gnodet.


- uses: actions/setup-java@v4
with:
java-version: '21'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [REGRESSION] Unpinned action — supply-chain risk.

This was fixed in 9c41c1ad8e with actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1. All other workflows in this repo pin to a full commit SHA. This squash dropped the pin.

Suggested change
java-version: '21'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

distribution: 'temurin'
cache: maven

- name: Update lifecycle plugin versions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [REGRESSION] Unpinned action — supply-chain risk.

Fixed in 9c41c1ad8e with actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1. Same pattern as every other workflow in this repo.

Suggested change
- name: Update lifecycle plugin versions
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

branch: update/lifecycle-plugins-${{ matrix.branch }}
base: ${{ matrix.branch }}
commit-message: "chore: update Maven lifecycle plugin versions"
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [REGRESSION] Unpinned third-party action with write access — supply-chain risk.

Fixed in 9c41c1ad8e with peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.6. The latest v7 tag is now v7.0.11 (22a9089034f40e5a961c8808d113e2c98fb63676), but a SHA pin is mandatory here. This action runs with contents: write + pull-requests: write — a compromised mutable tag can exfiltrate secrets or push arbitrary code.

Suggested change
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11

commit-message: "chore: update Maven lifecycle plugin versions"
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"
body: |
Automated update of Maven lifecycle plugin versions via `versions:update-properties`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [REGRESSION] GITHUB_TOKEN won't trigger CI on the created PR.

This was fixed in 9c41c1ad8e by switching to secrets.GH_TOKEN. GitHub explicitly blocks on: pull_request CI workflows for PRs opened by a workflow using GITHUB_TOKEN. The resulting version-bump PRs will show no CI status and cannot be merged safely.

Suggested change
Automated update of Maven lifecycle plugin versions via `versions:update-properties`.
token: ${{ secrets.GH_TOKEN }}

with:
ref: ${{ matrix.branch }}

- uses: actions/setup-java@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [REGRESSION] Missing fail-fast: false.

Fixed in 4a29c56. With the default fail-fast: true, a transient failure on the master leg (flaky Central download, etc.) immediately cancels the maven-4.0.x leg, potentially leaving one branch un-updated with no signal.

Suggested change
- uses: actions/setup-java@v4
strategy:
fail-fast: false
matrix:
branch: [master, maven-4.0.x]

with:
ref: ${{ matrix.branch }}

- uses: actions/setup-java@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [UNRESOLVED] maven-4.0.x matrix leg is a no-op.

The versions-update profile only exists in master's pom.xml. On maven-4.0.x, -Pversions-update will cause Maven to warn "profile not found" (or hard-fail) and exit without updating anything. maven-4.0.x does have version.maven-*-plugin properties in impl/maven-core/pom.xml, but without the profile the artifact→property mappings are absent. The leg silently produces no PR every week.

Fix options:

  • Option A (recommended): Backport the versions-update profile to maven-4.0.x via a separate commit/PR on that branch.
  • Option B: Make the profile optional with -P?versions-update and accept the maven-4.0.x leg only works once the profile is backported.

Either way, the maven-4.0.x leg must not run until this is resolved, or the matrix should be reduced to [master] for now.

Comment thread pom.xml

The GitHub Actions workflow .github/workflows/update-lifecycle-plugins.yml
runs this command weekly and opens a PR when updates are found.
-->

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [REGRESSION] versions-maven-plugin 2.18.0 — outdated.

Bumped to 2.22.0 in 9a4db016. Current latest is 2.22.0.

Suggested change
-->
<version>2.22.0</version>

…*-plugin to lifecycle.*-plugin

The properties in impl/maven-core/pom.xml are renamed from version.maven-*-plugin
to lifecycle.*-plugin to match the keys used in plugin-versions.properties and
PluginVersions.java. All references updated consistently across:
- impl/maven-core/pom.xml (declarations and ${} references)
- pom.xml (versions-update profile property mappings)
- .github/workflows/update-lifecycle-plugins.yml (-DincludeProperties list)

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test compact


- uses: actions/setup-java@v4
with:
java-version: '21'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test inline

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 212763a7 (rename version.maven-*-pluginlifecycle.*-plugin properties).

Status of prior findings from f06f9e2968 review:

Finding Status
Unpinned actions/checkout@v4 STILL OPEN
Unpinned actions/setup-java@v4 STILL OPEN
Unpinned peter-evans/create-pull-request@v7 STILL OPEN
secrets.GITHUB_TOKEN → CI won't trigger on created PRs STILL OPEN
Missing fail-fast: false STILL OPEN
maven-4.0.x matrix leg is a no-op (profile only on master) STILL OPEN
versions-maven-plugin 2.18.0 outdated STILL OPEN

The new commit 212763a7 does not address any of the six workflow findings. It only renames the property keys — and introduces a new critical regression in the filter chain.

New regression (filter chain): plugin-versions.properties now has lifecycle.*-plugin keys but every filter expression still references ${version.maven-*-plugin} — the property names just deleted from pom.xml. At build time, Maven resource filtering won't resolve these references and the literal ${...} strings land in the JAR. The PluginVersions.version() guard then throws ExceptionInInitializerError at JVM startup — Maven won't start. All 13 expressions need updating: e.g. lifecycle.clean-plugin=${lifecycle.clean-plugin} (and likewise for all others).

maven-4.0.x leg (still open): The versions-update profile is defined only in master's root pom.xml. On maven-4.0.x, -Pversions-update will warn-and-no-op or hard-fail. Fix: restrict the matrix to [master] until the profile is backported.

This review was generated by an AI agent, Hermès on behalf of @gnodet.


- uses: actions/setup-java@v4
with:
java-version: '21'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [STILL OPEN] Unpinned action — supply-chain risk.

Every other workflow in this repo pins to a full commit SHA. With contents: write + pull-requests: write at the top level, a compromised mutable tag can exfiltrate secrets or push arbitrary code.

Suggested change
java-version: '21'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

distribution: 'temurin'
cache: maven

- name: Update lifecycle plugin versions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [STILL OPEN] Unpinned action — supply-chain risk.

Suggested change
- name: Update lifecycle plugin versions
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

branch: update/lifecycle-plugins-${{ matrix.branch }}
base: ${{ matrix.branch }}
commit-message: "chore: update Maven lifecycle plugin versions"
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [STILL OPEN] Unpinned third-party action with write access — supply-chain risk.

Runs with contents: write + pull-requests: write. A SHA pin is mandatory. Latest v7 is v7.0.11:

Suggested change
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11

commit-message: "chore: update Maven lifecycle plugin versions"
title: "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})"
body: |
Automated update of Maven lifecycle plugin versions via `versions:update-properties`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [STILL OPEN] GITHUB_TOKEN → CI won't trigger on created PRs.

GitHub explicitly blocks on: pull_request CI for PRs opened by a workflow using GITHUB_TOKEN. The resulting version-bump PRs will show no CI status and cannot be safely merged.

Suggested change
Automated update of Maven lifecycle plugin versions via `versions:update-properties`.
token: ${{ secrets.GH_TOKEN }}

Comment on lines +39 to +41
ref: ${{ matrix.branch }}

- uses: actions/setup-java@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [STILL OPEN] Missing fail-fast: false.

With the default fail-fast: true, a transient failure on one leg immediately cancels the other, leaving one branch un-updated with no signal.

Suggested change
ref: ${{ matrix.branch }}
- uses: actions/setup-java@v4
strategy:
fail-fast: false
matrix:
branch: [master, maven-4.0.x]

Comment thread pom.xml Outdated
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [STILL OPEN] versions-maven-plugin 2.18.0 — current latest is 2.22.0.

Suggested change
<version>2.18.0</version>
<version>2.22.0</version>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after fb38317f (address review comments — pin SHA, replace peter-evans action, secrets.GH_TOKEN, fail-fast, versions-maven-plugin 2.22.0, lifecycle.* property rename).

Status of all seven findings from the 212763a7 review:

Finding Status
Unpinned actions/checkout@v4 Resolved@3d3c42e5 (v7.0.1), matches maven.yml
Unpinned actions/setup-java@v4 Resolved@de7274f0 (v6.0.1), matches maven.yml
peter-evans/create-pull-request unpinned Resolved — replaced with gh pr create + git push
secrets.GITHUB_TOKEN won't trigger CI ResolvedGH_TOKEN: ${{ secrets.GH_TOKEN }}
Missing fail-fast: false Resolved — added at strategy level
versions-maven-plugin 2.18.0 outdated Resolved — 2.22.0
Filter chain breakage (lifecycle.* rename) Resolved — grep, properties, PluginVersions.java all consistent

One unresolved issue remains (raised previously by @cstamas, @ascheman, and earlier reviews) plus one documentation nit introduced in this commit.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment thread pom.xml Outdated
plugin artifacts, enabling:

mvn versions:update-properties -Pversions-update \
DincludeProperties="lifecycle.clean-plugin,..." \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 (nit) Typo in comment example — DincludeProperties missing leading -. Anyone copy-pasting this to run the command manually gets a Maven invocation with an unrecognized system property name DincludeProperties (treated as a property key whose value is "lifecycle.clean-plugin,..."), not a Maven property override.

Suggested change
DincludeProperties="lifecycle.clean-plugin,..." \
-DincludeProperties="lifecycle.clean-plugin,..." \

@gnodet-bot

Copy link
Copy Markdown

⚠️ (unresolved, raised by @cstamas @ascheman and previous reviews) maven-4.0.x matrix leg is still a no-op.

-P?versions-update prevents a profile-not-found failure (good), but the actual problem is different: maven-4.0.x's impl/maven-core/pom.xml still uses version.maven-*-plugin property names (the rename to lifecycle.* exists only on master). When the workflow runs:

mvn versions:update-properties -P?versions-update \
  -DincludeProperties="lifecycle.clean-plugin,..." \
  -pl impl/maven-core

...on maven-4.0.x, the properties lifecycle.clean-plugin etc. don't exist in that branch's POM → versions:update-properties has nothing to update → git diff --quiet impl/maven-core/pom.xml is always true → the step exits with "No updates found" every single run. The maven-4.0.x leg is a permanent silent no-op.

Fix options:

  1. Restrict the matrix to [master] until the property rename is backported: branch: [master]
  2. Backport the lifecycle.* property rename to maven-4.0.x

Option 1 is simpler and avoids touching the release branch unnecessarily.

This comment was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from fb38317 to a1bc79d Compare September 18, 2026 05:43

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after a1bc79d4 (rename properties lifecycle.clean-pluginlifecycle.maven-*-plugin, fix PluginVersions.java constants to pass maven-clean-plugin etc., fix plugin-versions.properties keys, fix workflow -DincludeProperties to match new names).

Status of all seven findings from fb38317f review:

Finding Status
Unpinned actions/checkout@v4 Resolved@3d3c42e5 (v7.0.1)
Unpinned actions/setup-java@v4 Resolved@de7274f0 (v6.0.1)
peter-evans/create-pull-request unpinned Resolved — replaced with gh pr create
secrets.GITHUB_TOKEN won't trigger CI ResolvedGH_TOKEN: ${{ secrets.GH_TOKEN }}
fail-fast: false missing Resolved
versions-maven-plugin 2.18.0 outdated Resolved — 2.22.0 in profile
Filter chain (lifecycle.* rename, PluginVersions key, plugin-versions.properties) Resolved — consistent end-to-end

One unresolved issue remains (raised since the first review by @cstamas, @ascheman, and previous bot reviews) plus one nit.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

strategy:
fail-fast: false
matrix:
branch: [master, maven-4.0.x]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ maven-4.0.x matrix leg is still a silent no-op (unresolved since initial review).

The versions-update profile is defined only in master's pom.xml. On maven-4.0.x, -P?versions-update silently skips the profile (the ? prefix suppresses the failure). versions:update-properties then runs with no <property> mappings, finds nothing to update, git diff stays empty, and the step exits with "No updates found for maven-4.0.x" every single run — no PR is ever created.

Simplest fix: restrict the matrix to master until the property rename and the versions-update profile are backported to maven-4.0.x.

Suggested change
branch: [master, maven-4.0.x]
branch: [master]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problème will be fixed with #13172 on maven-4.0.x branch.

Comment on lines +29 to +30
* at build time from POM properties ({@code version.maven-<name>-plugin}).
* The properties file uses {@code lifecycle.<name>-plugin} keys.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 (nit) First Javadoc line is stale. The newly added second line (lifecycle.<name>-plugin keys) is correct, but the first line still says {@code version.maven-<name>-plugin}, which is the old property name scheme. Both lines now say different things for what is effectively the same concept.

Suggested change
* at build time from POM properties ({@code version.maven-<name>-plugin}).
* The properties file uses {@code lifecycle.<name>-plugin} keys.
* at build time from POM properties ({@code lifecycle.maven-<name>-plugin}).
* The properties file uses those same keys.

@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from a1bc79d to c286d21 Compare September 18, 2026 05:54

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after c286d21166 (rename properties version.maven-*-pluginlifecycle.*-plugin, move versions-update profile from impl/maven-core/pom.xml to root pom.xml).

Status of prior findings:

Finding Status
github.token regression (reverted to secrets.GH_TOKEN) ResolvedGH_TOKEN: ${{ secrets.GH_TOKEN }} present
SHA pins (actions/checkout, actions/setup-java) Resolved
fail-fast: false Resolved
--force-with-lease--force Resolved
versions-maven-plugin 2.22.0 Resolved
Filter chain consistency (lifecycle.* end-to-end) Resolvedplugin-versions.properties, PluginVersions.java key, and pom.xml properties all consistent

Two issues remain.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

* <p>
* Versions are read from {@code plugin-versions.properties}, which is filtered
* at build time from POM properties ({@code version.maven-<name>-plugin}).
* The properties file uses {@code lifecycle.<name>-plugin} keys.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 (nit) Stale Javadoc on the preceding line. The added line 30 correctly documents the lifecycle.<name>-plugin keys used in the properties file. But line 29 still says the values are filtered from POM properties {@code version.maven-<name>-plugin} — which no longer exist on master after this rename. Lines 29–30 now contradict each other: line 29 says the source is version.maven-*, line 30 says lifecycle.*.

Fix line 29 to match:

Suggested change
* The properties file uses {@code lifecycle.<name>-plugin} keys.
* at build time from POM properties ({@code lifecycle.maven-<name>-plugin}).
* The properties file uses {@code lifecycle.<name>-plugin} keys.

@gnodet-bot

Copy link
Copy Markdown

⚠️ (unresolved, raised by @cstamas, @ascheman, and every prior review) maven-4.0.x matrix leg is still a permanent silent no-op.

maven-4.0.x still uses version.maven-*-plugin property names (confirmed from the branch — unchanged). The workflow runs with -DincludeProperties="lifecycle.maven-clean-plugin,...". On maven-4.0.x:

  • -P?versions-update → profile absent → no property→artifact mapping configured
  • -DincludeProperties="lifecycle.maven-*-plugin" → those properties don't exist in maven-4.0.x's impl/maven-core/pom.xml
  • versions:update-properties has nothing to update → git diff --quiet is always true → prints "No updates found" every run

This leg has never produced a PR and never will under the current setup.

Fix options:

  1. Restrict the matrix to [master] until the lifecycle.* property rename is backported to maven-4.0.x:
    matrix:
      branch: [master]
  2. Backport the lifecycle.* rename to maven-4.0.x and add the versions-update profile there too.

Option 1 is the safer immediate fix — it avoids touching the release branch and makes the actual behavior explicit.

This comment was generated by an AI agent, Hermès on behalf of @gnodet.

- Pin actions/checkout and actions/setup-java to SHA (same as maven.yml)
- Replace peter-evans/create-pull-request with gh pr create + git push
- Switch to secrets.GH_TOKEN so created PRs trigger CI
- Move write permissions to job level (workflow-level: contents: read)
- Add fail-fast: false to matrix strategy
- Use -P?versions-update to make profile optional on maven-4.0.x
- Bump versions-maven-plugin 2.18.0 -> 2.22.0
- Fix grep pattern to match lifecycle.* properties
- Fix plugin-versions.properties: lifecycle.* keys + lifecycle.* values
- Fix plugin-versions.properties comment
@gnodet
gnodet force-pushed the feature/update-lifecycle-plugins-workflow branch from c286d21 to c6f066c Compare September 18, 2026 06:11

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after c6f066cb (address review comments — SHA pins, replace peter-evans action, secrets.GH_TOKEN, job-level permissions, fail-fast: false, -P?versions-update, bump versions-maven-plugin 2.22.0, fix grep pattern, fix plugin-versions.properties keys+values+comment).

Status of prior findings:

Finding Status
--force-with-lease without remote tracking ref Resolved — plain --force (line 76)
Spurious backslash in --body Resolved\\\`` in raw YAML = `` in bash double-quoted string = literal backtick; renders correctly in GitHub Markdown
pom.xml comment-to-code mismatch (toolbox vs versions) Resolved — workflow now runs versions:update-properties, comment is accurate
maven-4.0.x matrix leg is a permanent silent no-op Still unresolved — see below

One issue remains (unresolved since the first review, raised by @cstamas, @ascheman, and every prior review):

The maven-4.0.x leg will never produce a PR. -P?versions-update correctly prevents a build failure when the profile is absent (good fix) — but the root problem is different: maven-4.0.x's impl/maven-core/pom.xml still uses version.maven-*-plugin property names. The workflow passes -DincludeProperties="lifecycle.maven-*-plugin,..." — those property names do not exist in the maven-4.0.x POM. versions:update-properties finds nothing to update, git diff --quiet impl/maven-core/pom.xml is always true, the step exits with "No updates found" every single run. The maven-4.0.x leg consumes CI minutes weekly for zero benefit.

Two options:

  1. Restrict the matrix to [master] until the lifecycle.* rename is backported to maven-4.0.x (simpler, safer for the release branch)
  2. Backport the lifecycle.* property rename to maven-4.0.x and add the versions-update profile there too

Option 1 is the lower-risk immediate fix — it makes the actual behavior explicit and avoids touching the release branch.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

strategy:
fail-fast: false
matrix:
branch: [master, maven-4.0.x]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ (unresolved, raised by @cstamas, @ascheman, and every prior review) maven-4.0.x matrix leg is a permanent silent no-op.

-P?versions-update prevents a build failure when the profile is absent on maven-4.0.x — but the core issue is a property name mismatch: maven-4.0.x's impl/maven-core/pom.xml uses version.maven-*-plugin property names, while the workflow passes -DincludeProperties="lifecycle.maven-clean-plugin,...". Those lifecycle.* properties do not exist on that branch. versions:update-properties has nothing to update, git diff --quiet is always true, and the leg exits "No updates found" every weekly run without ever creating a PR.

Simplest fix — restrict to master until the rename is backported:

Suggested change
branch: [master, maven-4.0.x]
branch: [master]

Alternatively, backport the lifecycle.* rename to maven-4.0.x and add the versions-update profile there too (more work, but gives automated updates for the 4.0.x release branch).

gnodet added a commit that referenced this pull request Sep 18, 2026
…ions (maven-4.0.x)

Backport of #13166 to `maven-4.0.x`.

Adds the `versions-update` profile in `pom.xml` and the `.github/workflows/update-lifecycle-plugins.yml` workflow that runs `toolbox:plugin-versions` weekly to keep the 13 Maven lifecycle plugin versions in `impl/maven-core/pom.xml` up to date.

- Rename lifecycle plugin version properties from `version.maven-*-plugin` to `lifecycle.*-plugin` in `impl/maven-core/pom.xml`
- Update `plugin-versions.properties` keys and values to `lifecycle.*-plugin`
- Update `PluginVersions.java` to use `lifecycle.` prefix and short names
- Add `versions-update` profile to root `pom.xml`
- Add `.github/workflows/update-lifecycle-plugins.yml`
@gnodet
gnodet merged commit ab89470 into apache:master Sep 18, 2026
20 checks passed
@github-actions github-actions Bot added this to the 4.1.0 milestone Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@gnodet Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants