Skip to content

Commit 89fd24e

Browse files
gnodetclaude
andcommitted
Fix mvnup PLUGIN_UPGRADES inconsistencies for compiler and exec plugins
maven-compiler-plugin was listed as 3.2.0 but Maven Central only has 3.2, causing resolution failures. exec-maven-plugin had wrong groupId (org.apache.maven.plugins) and artifactId (maven-exec-plugin), inconsistent with getPluginUpgradesMap() which correctly uses org.codehaus.mojo:exec-maven-plugin. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 431bb39 commit 89fd24e

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ public class PluginUpgradeStrategy extends AbstractUpgradeStrategy {
6767

6868
private static final List<PluginUpgrade> PLUGIN_UPGRADES = List.of(
6969
new PluginUpgrade(
70-
DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-compiler-plugin", "3.2.0", MAVEN_4_COMPATIBILITY_REASON),
71-
new PluginUpgrade(
72-
DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-exec-plugin", "3.2.0", MAVEN_4_COMPATIBILITY_REASON),
70+
DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-compiler-plugin", "3.2", MAVEN_4_COMPATIBILITY_REASON),
71+
new PluginUpgrade("org.codehaus.mojo", "exec-maven-plugin", "3.2.0", MAVEN_4_COMPATIBILITY_REASON),
7372
new PluginUpgrade(
7473
DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-enforcer-plugin", "3.5.0", MAVEN_4_COMPATIBILITY_REASON),
7574
new PluginUpgrade("org.codehaus.mojo", "flatten-maven-plugin", "1.2.7", MAVEN_4_COMPATIBILITY_REASON),

impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ void shouldNotUpgradePluginWithoutVersion() throws Exception {
521521
<build>
522522
<plugins>
523523
<plugin>
524-
<groupId>org.apache.maven.plugins</groupId>
525-
<artifactId>maven-exec-plugin</artifactId>
524+
<groupId>org.codehaus.mojo</groupId>
525+
<artifactId>exec-maven-plugin</artifactId>
526526
<!-- No version - inherited from parent or pluginManagement -->
527527
</plugin>
528528
</plugins>
@@ -553,8 +553,8 @@ void shouldNotUpgradeWhenPropertyNotFound() throws Exception {
553553
<build>
554554
<plugins>
555555
<plugin>
556-
<groupId>org.apache.maven.plugins</groupId>
557-
<artifactId>maven-exec-plugin</artifactId>
556+
<groupId>org.codehaus.mojo</groupId>
557+
<artifactId>exec-maven-plugin</artifactId>
558558
<version>${exec.plugin.version}</version>
559559
</plugin>
560560
</plugins>
@@ -737,7 +737,7 @@ void shouldHavePredefinedPluginUpgrades() throws Exception {
737737
boolean hasCompilerPlugin =
738738
upgrades.stream().anyMatch(upgrade -> "maven-compiler-plugin".equals(upgrade.artifactId()));
739739
boolean hasExecPlugin =
740-
upgrades.stream().anyMatch(upgrade -> "maven-exec-plugin".equals(upgrade.artifactId()));
740+
upgrades.stream().anyMatch(upgrade -> "exec-maven-plugin".equals(upgrade.artifactId()));
741741
boolean hasSurefirePlugin =
742742
upgrades.stream().anyMatch(upgrade -> "maven-surefire-plugin".equals(upgrade.artifactId()));
743743
boolean hasFailsafePlugin =
@@ -746,7 +746,7 @@ void shouldHavePredefinedPluginUpgrades() throws Exception {
746746
upgrades.stream().anyMatch(upgrade -> "maven-surefire-report-plugin".equals(upgrade.artifactId()));
747747

748748
assertTrue(hasCompilerPlugin, "Should include maven-compiler-plugin upgrade");
749-
assertTrue(hasExecPlugin, "Should include maven-exec-plugin upgrade");
749+
assertTrue(hasExecPlugin, "Should include exec-maven-plugin upgrade");
750750
assertTrue(hasSurefirePlugin, "Should include maven-surefire-plugin upgrade");
751751
assertTrue(hasFailsafePlugin, "Should include maven-failsafe-plugin upgrade");
752752
assertTrue(hasSurefireReportPlugin, "Should include maven-surefire-report-plugin upgrade");

0 commit comments

Comments
 (0)