This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new ccde2a608 Write the XML report with plexus-xml instead of
maven-shared-utils
ccde2a608 is described below
commit ccde2a6086e95b75af007d7dcd409447db8c2432
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Nov 8 19:19:14 2026 +0000
Write the XML report with plexus-xml instead of maven-shared-utils
plexus-xml is shaded into surefire-shared-utils like commons-io and
commons-lang3, so the writers are on the in-process class path too
(forkCount=0 builds the reporter inside the plugin's isolated loader,
which holds only Surefire's own artifacts) and project tests never see
the real plexus-xml classes. plexus-utils stays out of the shade;
plexus-xml 3.x references nothing from it.
Part of #3574.
---
.../plugin/surefire/report/StatelessXmlReporter.java | 4 ++--
.../plugin/surefire/report/StatelessXmlReporterTest.java | 16 ++++++++--------
surefire-shared-utils/pom.xml | 16 ++++++++++++++++
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
index 1ae9acc28..fc651c96e 100644
---
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -39,8 +39,8 @@
import
org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton;
import org.apache.maven.surefire.api.report.SafeThrowable;
import org.apache.maven.surefire.extensions.StatelessReportEventListener;
-import org.apache.maven.surefire.shared.utils.xml.PrettyPrintXMLWriter;
-import org.apache.maven.surefire.shared.utils.xml.XMLWriter;
+import org.apache.maven.surefire.shared.xml.PrettyPrintXMLWriter;
+import org.apache.maven.surefire.shared.xml.XMLWriter;
import static java.nio.charset.StandardCharsets.UTF_8;
import static
org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType;
diff --git
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
index 951b191ea..7b0d99701 100644
---
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
+++
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
@@ -39,8 +39,8 @@
import org.apache.maven.surefire.api.report.ReportEntry;
import org.apache.maven.surefire.api.report.SimpleReportEntry;
import org.apache.maven.surefire.api.report.StackTraceWriter;
-import org.apache.maven.surefire.shared.utils.xml.Xpp3Dom;
-import org.apache.maven.surefire.shared.utils.xml.Xpp3DomBuilder;
+import org.apache.maven.surefire.shared.xml.Xpp3Dom;
+import org.apache.maven.surefire.shared.xml.Xpp3DomBuilder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -190,7 +190,7 @@ public void testFileNameWithoutSuffix() {
}
@Test
- public void testAllFieldsSerialized() throws IOException {
+ public void testAllFieldsSerialized() throws Exception {
ReportEntry reportEntry =
new SimpleReportEntry(NORMAL_RUN, 0L, getClass().getName(),
null, TEST_ONE, null, 12);
WrappedReportEntry testSetReportEntry =
@@ -277,7 +277,7 @@ public void testAllFieldsSerialized() throws IOException {
}
@Test
- public void testOutputRerunFlakyFailure() throws IOException {
+ public void testOutputRerunFlakyFailure() throws Exception {
WrappedReportEntry testSetReportEntry = new WrappedReportEntry(
new SimpleReportEntry(NORMAL_RUN, 0L, getClass().getName(),
null, TEST_ONE, null, 12),
ReportEntryType.SUCCESS,
@@ -412,7 +412,7 @@ public void testOutputRerunFlakyFailure() throws
IOException {
}
@Test
- public void testOutputRerunFlakyAssumption() throws IOException {
+ public void testOutputRerunFlakyAssumption() throws Exception {
expectedReportFile = new File(reportDir, "TEST-" +
getClass().getName() + ".xml");
StackTraceWriter stackTraceWriterOne = new
DeserializedStacktraceWriter("A fud msg", "trimmed", "fail at foo");
@@ -509,7 +509,7 @@ public void testOutputRerunFlakyAssumption() throws
IOException {
}
@Test
- public void testIdenticalNamesWithDistinctIdsRemainSeparate() throws
IOException {
+ public void testIdenticalNamesWithDistinctIdsRemainSeparate() throws
Exception {
expectedReportFile = new File(reportDir, "TEST-" +
getClass().getName() + ".xml");
StackTraceWriter failure = new DeserializedStacktraceWriter("failure",
"trimmed", "failed");
@@ -587,7 +587,7 @@ public void
testIdenticalNamesWithDistinctIdsRemainSeparate() throws IOException
}
@Test
- public void testSkippedExecutionInFlakeDoesNotCreateEmptyElement() throws
IOException {
+ public void testSkippedExecutionInFlakeDoesNotCreateEmptyElement() throws
Exception {
expectedReportFile = new File(reportDir, "TEST-" +
getClass().getName() + ".xml");
StackTraceWriter failure = new DeserializedStacktraceWriter("failure",
"trimmed", "failed");
@@ -804,7 +804,7 @@ public void
testReporterHandlesATestWithoutMessageAndWithEmptyStackTrace() {
}
@Test
- public void testClassnameUsesActualClassNameWhenPhrasedClassNameDisabled()
throws IOException {
+ public void testClassnameUsesActualClassNameWhenPhrasedClassNameDisabled()
throws Exception {
String actualClassName = "MyTest";
String displayName = "NewName";
diff --git a/surefire-shared-utils/pom.xml b/surefire-shared-utils/pom.xml
index 8e6a98901..922092742 100644
--- a/surefire-shared-utils/pom.xml
+++ b/surefire-shared-utils/pom.xml
@@ -59,6 +59,18 @@
<artifactId>commons-compress</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-xml</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <!-- plexus-xml 3.x references nothing from it; Maven provides it to
the plugin -->
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<build>
@@ -108,6 +120,10 @@
<pattern>org.apache.commons.compress</pattern>
<shadedPattern>org.apache.maven.surefire.shared.compress</shadedPattern>
</relocation>
+ <relocation>
+ <pattern>org.codehaus.plexus.util.xml</pattern>
+
<shadedPattern>org.apache.maven.surefire.shared.xml</shadedPattern>
+ </relocation>
</relocations>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"
/>