This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 431bb396ff Fix mvnup recommending non-existent
maven-enforcer-plugin:3.5.2 (#12155)
431bb396ff is described below
commit 431bb396ff975cbbbc57313e3ce52950f612867f
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue May 26 23:43:19 2026 +0200
Fix mvnup recommending non-existent maven-enforcer-plugin:3.5.2 (#12155)
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 15d7ac74a2..d1961700e7 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);
String version = editor.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