diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java index 842eb9983..7f1660317 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java @@ -21,6 +21,7 @@ import java.io.File; import java.util.List; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.shared.verifier.Verifier; import org.apache.maven.shared.verifier.util.ResourceExtractor; import org.junit.jupiter.api.Test; @@ -59,8 +60,13 @@ public void testit() throws Exception { List lines = verifier.loadLines(verifier.getLogFileName(), null); for (String line : lines) { if (line.contains(":bad/id:")) { - assertTrue("Line number not found in: " + line, line.indexOf("34") > 0); - assertTrue("Column number not found in: " + line, line.indexOf("19") > 0); + String location; + if (getMavenVersion().compareTo(new DefaultArtifactVersion("4.0.0-alpha-8-SNAPSHOT")) >= 0) { + location = "line 34, column 7"; + } else { + location = "line 34, column 19"; + } + assertTrue("Position not found in: " + line, line.indexOf(location) > 0); foundError = true; break; } diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java index 39aa2c4ba..bf1ffec36 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java @@ -68,10 +68,15 @@ public void testit() throws Exception { List lines = verifier.loadLines(verifier.getLogFileName(), null); boolean foundWarning = false; + boolean isWarning = false; for (String line : lines) { - if (line.matches("(?i)\\[WARNING\\].*unrecognised tag.+unknown.+2.*")) { - foundWarning = true; - break; + if (!isWarning) { + isWarning = line.startsWith("[WARNING]"); + } else { + if (line.matches("(?i).*unrecognised tag.+unknown.+2.*")) { + foundWarning = true; + break; + } } } assertTrue(foundWarning); diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java index c45684240..61c1bf483 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java @@ -59,8 +59,12 @@ public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithoutBuildCons assertEquals("1.0.0.changelist", props.getProperty("project.version")); List lines = verifier.loadFile(new File(testDir, "log.txt"), false); + boolean seenScanning = false; for (String line : lines) { - assertFalse(line, line.contains("WARNING")); + seenScanning |= line.contains("Scanning for projects"); + if (seenScanning) { + assertFalse(String.join("\n", lines), line.contains("WARNING")); + } } } @@ -88,8 +92,12 @@ public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithBuildConsume assertEquals("1.0.0.changelist", props.getProperty("project.version")); List lines = verifier.loadFile(new File(testDir, "log-bc.txt"), false); + boolean seenScanning = false; for (String line : lines) { - assertFalse(line, line.contains("WARNING")); + seenScanning |= line.contains("Scanning for projects"); + if (seenScanning) { + assertFalse(String.join("\n", lines), line.contains("WARNING")); + } } } } diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom index 46447bf64..d557a66ca 100644 --- a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom +++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom @@ -1,5 +1,4 @@ - - 4.0.0 org.sonatype.mavenbook.multi diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom index b7261985d..88015cd71 100644 --- a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom +++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom index 970ec4779..0c1aedf05 100644 --- a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom +++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom index 1ecae6db7..680b417c2 100644 --- a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom +++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom index 9291614f0..10700cb4e 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom @@ -1,5 +1,4 @@ - - 4.0.0 org.sonatype.mavenbook.multi diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom index cad5dee90..1b1551516 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom index 05580dcd1..d902a3c6c 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom index 43bfc9c55..d4aa843d4 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom index a422ba06a..9cc486860 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom @@ -1,5 +1,4 @@ - - 4.0.0 diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom index a7fedb617..00f362464 100644 --- a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom +++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom @@ -1,5 +1,4 @@ - - 4.0.0