Skip to content

[4.0.x] Fix mvnup plugin upgrade for plugins inherited in build/plugins#12159

Closed
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/12157-to-4.0.x
Closed

[4.0.x] Fix mvnup plugin upgrade for plugins inherited in build/plugins#12159
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/12157-to-4.0.x

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 26, 2026

Summary

Backport of #12157 to maven-4.0.x.

  • When a remote parent POM declares a plugin with an explicit version in <build><plugins> (not <pluginManagement>), mvnup's plugin upgrade strategy now adds the plugin to both <pluginManagement> and <build><plugins> in the child project
  • Previously, only a <pluginManagement> entry was added, which is insufficient because the parent's <plugins> version takes precedence over the child's <pluginManagement>

Cherry-picked cleanly from master.

Note: The InheritedPluginDetectionTests tests (including shouldDetectInheritedPluginsFromRemoteParent which existed before this PR) are pre-existing failures on maven-4.0.x — they fail on the base branch without this change as well.

Test plan

🤖 Generated with Claude Code

When a remote parent POM declares a plugin with an explicit version in
<build><plugins>, adding a <pluginManagement> entry in the child is
insufficient to override it. The parent's <plugins> version takes
precedence over the child's <pluginManagement>.

Now the plugin upgrade strategy adds plugins to both <pluginManagement>
(for downstream children) and <build><plugins> (to override the
inherited version) when the effective model shows outdated plugins in
the build/plugins section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented May 27, 2026

Claude Code on behalf of Guillaume Nodet

Closing — the master branch PR (#12157) was superseded by a more precise implementation. Will backport the new version separately.

@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented May 27, 2026

Claude Code on behalf of Guillaume Nodet

Superseded by #12165. Will backport separately.

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.

1 participant