This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/maven-4.0.x by this push:
     new d3534a6a4b Fix mvnup recommending non-existent 
maven-enforcer-plugin:3.5.2 (#12155) (#12156)
d3534a6a4b is described below

commit d3534a6a4bb1b6abdfeb7df07c2d3b4b85fb7885
Author: Guillaume Nodet <[email protected]>
AuthorDate: Wed May 27 00:29:06 2026 +0200

    Fix mvnup recommending non-existent maven-enforcer-plugin:3.5.2 (#12155) 
(#12156)
    
    The enforcer plugin has no 3.5.2 release (versions go 3.5.0 -> 3.6.0).
    The version was confused with maven-surefire-plugin which does have 3.5.2.
    Changed the recommended minimum to 3.5.0, which is a real release.
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java     | 7 ++-----
 .../maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java | 6 +++---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git 
a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java
 
b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java
index 552ab1c2cf..6a6d16cb15 100644
--- 
a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java
+++ 
b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java
@@ -71,10 +71,7 @@ public class PluginUpgradeStrategy extends 
AbstractUpgradeStrategy {
             new PluginUpgrade(
                     DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-exec-plugin", 
"3.2.0", MAVEN_4_COMPATIBILITY_REASON),
             new PluginUpgrade(
-                    DEFAULT_MAVEN_PLUGIN_GROUP_ID,
-                    "maven-enforcer-plugin",
-                    "3.5.2",
-                    "Versions before 3.5.2 use removed 
PluginParameterExpressionEvaluator API incompatible with Maven 4"),
+                    DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-enforcer-plugin", 
"3.5.0", MAVEN_4_COMPATIBILITY_REASON),
             new PluginUpgrade("org.codehaus.mojo", "flatten-maven-plugin", 
"1.2.7", MAVEN_4_COMPATIBILITY_REASON),
             new PluginUpgrade(
                     DEFAULT_MAVEN_PLUGIN_GROUP_ID, "maven-shade-plugin", 
"3.5.0", MAVEN_4_COMPATIBILITY_REASON),
@@ -243,7 +240,7 @@ private Map<String, PluginUpgradeInfo> 
getPluginUpgradesMap() {
                 new PluginUpgradeInfo("org.codehaus.mojo", 
"exec-maven-plugin", "3.2.0"));
         upgrades.put(
                 DEFAULT_MAVEN_PLUGIN_GROUP_ID + ":maven-enforcer-plugin",
-                new PluginUpgradeInfo(DEFAULT_MAVEN_PLUGIN_GROUP_ID, 
"maven-enforcer-plugin", "3.5.2"));
+                new PluginUpgradeInfo(DEFAULT_MAVEN_PLUGIN_GROUP_ID, 
"maven-enforcer-plugin", "3.5.0"));
         upgrades.put(
                 "org.codehaus.mojo:flatten-maven-plugin",
                 new PluginUpgradeInfo("org.codehaus.mojo", 
"flatten-maven-plugin", "1.2.7"));
diff --git 
a/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java
 
b/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java
index 2328e905d1..8a6aa1a470 100644
--- 
a/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java
+++ 
b/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java
@@ -216,14 +216,14 @@ void shouldUpgradeMilestoneVersionBelowRelease() throws 
Exception {
             UpgradeResult result = strategy.doApply(context, pomMap);
 
             assertTrue(result.success(), "Plugin upgrade should succeed");
-            assertTrue(result.modifiedCount() > 0, "Should have upgraded 
3.0.0-M1 to 3.5.2");
+            assertTrue(result.modifiedCount() > 0, "Should have upgraded 
3.0.0-M1 to 3.5.0");
 
             Editor editor = new Editor(document);
             Element root = editor.root();
             String version = root.path("build", "plugins", "plugin", "version")
                     .map(Element::textContentTrimmed)
                     .orElse(null);
-            assertEquals("3.5.2", version, "3.0.0-M1 should be upgraded to 
3.5.2");
+            assertEquals("3.5.0", version, "3.0.0-M1 should be upgraded to 
3.5.0");
         }
 
         @Test
@@ -265,7 +265,7 @@ void shouldUpgradePluginInPluginManagement() throws 
Exception {
             String version = root.path("build", "pluginManagement", "plugins", 
"plugin", "version")
                     .map(Element::textContentTrimmed)
                     .orElse(null);
-            assertEquals("3.5.2", version);
+            assertEquals("3.5.0", version);
         }
 
         @Test

Reply via email to