[mvnup] Add maven-war-plugin and maven-ear-plugin to plugin upgrade list - #12685
[mvnup] Add maven-war-plugin and maven-ear-plugin to plugin upgrade list#12685gnodet wants to merge 1 commit into
Conversation
gnodet
left a comment
There was a problem hiding this comment.
Two issues found — one is a bug:
1. Missing entries in getPluginUpgradesMap() (high severity)
The new maven-war-plugin and maven-ear-plugin entries are added to the PLUGIN_UPGRADES list (used by getPluginUpgradesAsMap() for effective model analysis) but not to getPluginUpgradesMap() (the manually-maintained HashMap used by upgradePluginsInDocument() for direct POM XML scanning). This means POMs that directly declare these plugins with explicit versions will not be upgraded through the document scanning path.
All 15 other plugins appear in both locations. This exact inconsistency class was previously identified and fixed in PR #12200.
Suggested fix — add to getPluginUpgradesMap() before the return upgrades; statement:
upgrades.put(
DEFAULT_MAVEN_PLUGIN_GROUP_ID + ":maven-war-plugin",
new PluginUpgradeInfo(DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-war-plugin", "3.4.0"));
upgrades.put(
DEFAULT_MAVEN_PLUGIN_GROUP_ID + ":maven-ear-plugin",
new PluginUpgradeInfo(DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-ear-plugin", "3.4.0"));2. No tests for the new plugins (medium severity)
The existing test suite has individual test cases for surefire, failsafe, surefire-report, jaxb2, and quarkus. Following this established pattern, tests should verify that old versions of maven-war-plugin and maven-ear-plugin are upgraded to 3.4.0.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
Both plugins use reflection on java.util.Properties internals (via XStream/plexus-archiver) in older versions, which is blocked by the JDK 17+ module system. Since Maven 4 requires JDK 17+, mvnup should upgrade these plugins to compatible versions: - maven-war-plugin: min 3.4.0 (fixed in 3.3.2+) - maven-ear-plugin: min 3.4.0 (fixed in 3.3.0+) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9d1de4d to
1e0eb72
Compare
Summary
maven-war-plugin(min 3.4.0) to thePLUGIN_UPGRADESlist inPluginUpgradeStrategymaven-ear-plugin(min 3.4.0) to thePLUGIN_UPGRADESlist inPluginUpgradeStrategyBoth plugins use reflection on
java.util.Propertiesinternals (via XStream/plexus-archiver) in older versions, which is blocked by the JDK 17+ module system. Since Maven 4 requires JDK 17+,mvnupshould upgrade these plugins to compatible versions.Affected versions
maven-war-pluginPropertiesConverterreflects onProperties.defaultsfieldmaven-ear-pluginplexus-archiveruses reflection blocked by JDK 17+ modulesContext
Discovered during Maven 4 compatibility testing — projects like
mina-vysperusingmaven-war-plugin:2.1.1crash with:Running
mvnup applydidn't fix this becausemaven-war-pluginwasn't in the upgrade list.🤖 Generated with Claude Code