Sitelet https://github.com/apache/maven/issues/12530
Skip to content

mvnup: add upgrade strategies for Maven 4 known compatibility issues #12530

Description

@gnodet

Description

The Maven 4 compatibility testing across 966 Apache projects reveals several categories of known issues that could be automatically fixed by mvnup. Adding these as mvnup upgrade strategies would significantly reduce the number of projects that fail under Maven 4.

Proposed mvnup Strategies

Plugin version upgrades (straightforward)

Known Issue Fix Details
scala-maven-plugin#911 Upgrade net.alchim31.maven:scala-maven-plugin to ≥ 4.9.5 Older versions call add() on immutable lists returned by Maven 4 API
beta-plugin-api-break Upgrade plugins pinned at 4.0.0-beta-1 Beta API methods were renamed/removed before RC
ancient-enforcer-plugin Upgrade maven-enforcer-plugin to ≥ 3.0.0 Older versions use removed PluginParameterExpressionEvaluator constructor
exec-plugin-getcontainer Upgrade exec-maven-plugin to ≥ 3.2.0 Older versions call MavenSession.getContainer() which returns null in Maven 4
old-compiler-plugin-errorprone Upgrade maven-compiler-plugin to ≥ 3.11 Older versions can't find ErrorProne plug-in under Maven 4 classloading

Plugin migration (groupId change)

Known Issue Fix Details
old-scala-tools-plugin Migrate org.scala-tools:maven-scala-plugin → net.alchim31.maven:scala-maven-plugin Ancient plugin (unmaintained since 2011) calls add() on immutable lists

POM fixes

Known Issue Fix Details
duplicated-pom-tag Remove duplicate XML elements (<artifactId>, <properties>, etc.) Maven 4's stricter POM parser rejects duplicates that Maven 3 silently accepted
duplicate-dependency-declarations Remove duplicate <dependency> declarations (same groupId:artifactId) Maven 4's stricter validation rejects what Maven 3 silently merged

Impact

These 8 strategies would address 8 of 27 known issues in the maven4-testing known-issues.json, covering projects like:

  • All projects using old scala-maven-plugin or org.scala-tools
  • Projects with enforcer plugin < 3.0.0
  • Projects with exec-maven-plugin < 3.2.0
  • Projects with compiler plugin < 3.11
  • Projects with duplicate POM elements or dependency declarations

Reference

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions