Skip to content

[Backport 4.0.x] Fix #12530: add mvnup upgrade strategies for Maven 4 known compatibility issues - #12560

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12532-mvnup-upgrade-strategies
Jul 28, 2026
Merged

[Backport 4.0.x] Fix #12530: add mvnup upgrade strategies for Maven 4 known compatibility issues#12560
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12532-mvnup-upgrade-strategies

Conversation

@gnodet

@gnodet gnodet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12532 to maven-4.0.x.

Cherry-pick of 82f438a — clean, no conflicts.

Add 4 new mvnup strategies addressing Maven 4 compatibility issues from
the maven4-testing project: update compiler-plugin min to 3.11.0 for
ErrorProne, detect and upgrade old 4.x alpha/beta/RC plugin versions,
migrate deprecated org.scala-tools:maven-scala-plugin to
net.alchim31.maven:scala-maven-plugin, and add DuplicateElementStrategy
to remove duplicate POM elements rejected by Maven 4's stricter parser.

Original PR: #12532
Closes #12530

…ity issues

Add 4 new mvnup strategies addressing Maven 4 compatibility issues from
the maven4-testing project: update compiler-plugin min to 3.11.0 for
ErrorProne, detect and upgrade old 4.x alpha/beta/RC plugin versions,
migrate deprecated org.scala-tools:maven-scala-plugin to
net.alchim31.maven:scala-maven-plugin, and add DuplicateElementStrategy
to remove duplicate POM elements rejected by Maven 4's stricter parser.
Refactors PluginUpgradeStrategy to derive its map from the PLUGIN_UPGRADES
list instead of maintaining a separate hand-coded map.

Closes #12532
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jul 28, 2026

@gnodet gnodet left a comment

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.

✅ Clean cherry-pick of the already-reviewed-and-merged PR #12532 to the 4.0.x branch. The diff is byte-identical to the original, all previous review feedback was addressed, and test coverage is solid (31 new tests across DuplicateElementStrategyTest and PluginUpgradeStrategyTest).

The four new strategies (ErrorProne-compatible compiler-plugin minimum, Maven 4 pre-release version upgrade, scala-plugin migration, and duplicate element removal) are all relevant to 4.0.x since they address Maven 4 compatibility issues.

Minor note (non-blocking): getPluginUpgradesMap() rebuilds a HashMap on every call while the analogous PLUGIN_MIGRATIONS_MAP was correctly hoisted to static final — could be made consistent in a follow-up.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 28, 2026
@gnodet
gnodet merged commit 32217cc into maven-4.0.x Jul 28, 2026
24 checks passed
@gnodet
gnodet deleted the backport/12532-mvnup-upgrade-strategies branch July 28, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant