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
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)
scala-maven-plugin#911net.alchim31.maven:scala-maven-pluginto ≥ 4.9.5add()on immutable lists returned by Maven 4 APIbeta-plugin-api-break4.0.0-beta-1ancient-enforcer-pluginmaven-enforcer-pluginto ≥ 3.0.0PluginParameterExpressionEvaluatorconstructorexec-plugin-getcontainerexec-maven-pluginto ≥ 3.2.0MavenSession.getContainer()which returns null in Maven 4old-compiler-plugin-errorpronemaven-compiler-pluginto ≥ 3.11Plugin migration (groupId change)
old-scala-tools-pluginorg.scala-tools:maven-scala-plugin→net.alchim31.maven:scala-maven-pluginadd()on immutable listsPOM fixes
duplicated-pom-tag<artifactId>,<properties>, etc.)duplicate-dependency-declarations<dependency>declarations (same groupId:artifactId)Impact
These 8 strategies would address 8 of 27 known issues in the maven4-testing known-issues.json, covering projects like:
Reference