diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java index f5431e275..81cce8eea 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java @@ -55,17 +55,12 @@ public void testit() throws Exception { // expected with Maven 4+ } - String logLevel; - if (matchesVersionRange("(,4.0.0-alpha-1)")) { - logLevel = "WARNING"; - } else { - logLevel = "ERROR"; - } - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); boolean foundMessage = false; for (String line : lines) { - if (line.startsWith("[" + logLevel + "]") + // Maven < 3.10.0 and rc releases use [WARNING]; Maven 3.10.0+ (VALIDATION_LEVEL_MAVEN_3_1 + // strict, post-rc-1) and Maven 4+ use [ERROR]. Accept either level. + if ((line.startsWith("[WARNING]") || line.startsWith("[ERROR]")) && line.indexOf( "duplicate declaration of plugin org.apache.maven.its.plugins:maven-it-plugin-expression") > 0) { diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java index 775bc360e..295bc9ec0 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java @@ -36,7 +36,9 @@ public class MavenITmng3719PomExecutionOrderingTest extends AbstractMavenIntegrationTestCase { public MavenITmng3719PomExecutionOrderingTest() { - super("[2.0.11,2.1.0-M1),[2.1.0-M2,4.0.0-alpha-1)"); + // Maven 3.10.0+ treats duplicate plugin declarations as errors (VALIDATION_LEVEL_MAVEN_3_1 strict) + // so the test fixture was updated to use a single merged plugin declaration instead. + super("[2.0.11,2.1.0-M1),[2.1.0-M2,)"); } /** diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java index ebff7e8f8..4f224eb00 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java @@ -90,17 +90,13 @@ private void test(String project) throws Exception { // expected with Maven 4+ } - String logLevel; - if (matchesVersionRange("(,4.0.0-alpha-1)")) { - logLevel = "WARNING"; - } else { - logLevel = "ERROR"; - } - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); boolean foundMessage = false; for (String line : lines) { - if (line.startsWith("[" + logLevel + "]") && line.indexOf("must be unique: junit:junit:jar") > 0) { + // Maven < 3.10.0 and rc releases use [WARNING]; Maven 3.10.0+ (VALIDATION_LEVEL_MAVEN_3_1 + // strict, post-rc-1) and Maven 4+ use [ERROR]. Accept either level. + if ((line.startsWith("[WARNING]") || line.startsWith("[ERROR]")) + && line.indexOf("must be unique: junit:junit:jar") > 0) { foundMessage = true; } } diff --git a/core-it-suite/src/test/resources/mng-3719/pom.xml b/core-it-suite/src/test/resources/mng-3719/pom.xml index ddd2c7334..b01b85103 100644 --- a/core-it-suite/src/test/resources/mng-3719/pom.xml +++ b/core-it-suite/src/test/resources/mng-3719/pom.xml @@ -34,6 +34,10 @@ under the License. + org.apache.maven.its.plugins maven-it-plugin-log-file @@ -49,41 +53,34 @@ under the License. target/step-1.properties - - - - org.apache.maven.its.plugins - maven-it-plugin-expression - 2.1-SNAPSHOT - - step 2 + step 3 - eval + reset validate - target/step-2.properties - - project/properties - + target/step-3.properties org.apache.maven.its.plugins - maven-it-plugin-log-file + maven-it-plugin-expression 2.1-SNAPSHOT - step 3 + step 2 - reset + eval validate - target/step-3.properties + target/step-2.properties + + project/properties +