Skip to content

Commit eaaf6d5

Browse files
committed
[MNG-7830] Switch from plexus-xml to stax / woodstox
1 parent c289abe commit eaaf6d5

File tree

13 files changed

+26
-27
lines changed

13 files changed

+26
-27
lines changed

core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.File;
2222
import java.util.List;
2323

24+
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
2425
import org.apache.maven.shared.verifier.Verifier;
2526
import org.apache.maven.shared.verifier.util.ResourceExtractor;
2627
import org.junit.jupiter.api.Test;
@@ -59,8 +60,13 @@ public void testit() throws Exception {
5960
List<String> lines = verifier.loadLines(verifier.getLogFileName(), null);
6061
for (String line : lines) {
6162
if (line.contains(":bad/id:")) {
62-
assertTrue("Line number not found in: " + line, line.indexOf("34") > 0);
63-
assertTrue("Column number not found in: " + line, line.indexOf("19") > 0);
63+
String location;
64+
if (getMavenVersion().compareTo(new DefaultArtifactVersion("4.0.0-alpha-8-SNAPSHOT")) >= 0) {
65+
location = "line 34, column 7";
66+
} else {
67+
location = "line 34, column 19";
68+
}
69+
assertTrue("Position not found in: " + line, line.indexOf(location) > 0);
6470
foundError = true;
6571
break;
6672
}

core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ public void testit() throws Exception {
6868

6969
List<String> lines = verifier.loadLines(verifier.getLogFileName(), null);
7070
boolean foundWarning = false;
71+
boolean isWarning = false;
7172
for (String line : lines) {
72-
if (line.matches("(?i)\\[WARNING\\].*unrecognised tag.+unknown.+2.*")) {
73-
foundWarning = true;
74-
break;
73+
if (!isWarning) {
74+
isWarning = line.startsWith("[WARNING]");
75+
} else {
76+
if (line.matches("(?i).*unrecognised tag.+unknown.+2.*")) {
77+
foundWarning = true;
78+
break;
79+
}
7580
}
7681
}
7782
assertTrue(foundWarning);

core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithoutBuildCons
5959
assertEquals("1.0.0.changelist", props.getProperty("project.version"));
6060

6161
List<String> lines = verifier.loadFile(new File(testDir, "log.txt"), false);
62+
boolean seenScanning = false;
6263
for (String line : lines) {
63-
assertFalse(line, line.contains("WARNING"));
64+
seenScanning |= line.contains("Scanning for projects");
65+
if (seenScanning) {
66+
assertFalse(String.join("\n", lines), line.contains("WARNING"));
67+
}
6468
}
6569
}
6670

@@ -88,8 +92,12 @@ public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithBuildConsume
8892
assertEquals("1.0.0.changelist", props.getProperty("project.version"));
8993

9094
List<String> lines = verifier.loadFile(new File(testDir, "log-bc.txt"), false);
95+
boolean seenScanning = false;
9196
for (String line : lines) {
92-
assertFalse(line, line.contains("WARNING"));
97+
seenScanning |= line.contains("Scanning for projects");
98+
if (seenScanning) {
99+
assertFalse(String.join("\n", lines), line.contains("WARNING"));
100+
}
93101
}
94102
}
95103
}

core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<groupId>org.sonatype.mavenbook.multi</groupId>

core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<parent>

core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<parent>

core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<parent>

core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<groupId>org.sonatype.mavenbook.multi</groupId>

core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<parent>

core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2321
<modelVersion>4.0.0</modelVersion>
2422
<parent>

0 commit comments

Comments
 (0)