Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,)");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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;
}
}
Expand Down
31 changes: 14 additions & 17 deletions core-it-suite/src/test/resources/mng-3719/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ under the License.

<build>
<plugins>
<!-- Merged into a single plugin declaration to avoid duplicate plugin errors.
The original test had two separate declarations of maven-it-plugin-log-file which were
merged by Maven < 3.10.0. Maven 3.10.0+ treats duplicate plugin declarations as errors
(VALIDATION_LEVEL_MAVEN_3_1 strict mode), so the executions are combined here. -->
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-log-file</artifactId>
Expand All @@ -49,41 +53,34 @@ under the License.
<logFile>target/step-1.properties</logFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>step 2</id>
<id>step 3</id>
<goals>
<goal>eval</goal>
<goal>reset</goal>
</goals>
<phase>validate</phase>
<configuration>
<outputFile>target/step-2.properties</outputFile>
<expressions>
<expression>project/properties</expression>
</expressions>
<logFile>target/step-3.properties</logFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-log-file</artifactId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>step 3</id>
<id>step 2</id>
<goals>
<goal>reset</goal>
<goal>eval</goal>
</goals>
<phase>validate</phase>
<configuration>
<logFile>target/step-3.properties</logFile>
<outputFile>target/step-2.properties</outputFile>
<expressions>
<expression>project/properties</expression>
</expressions>
</configuration>
</execution>
</executions>
Expand Down
Loading