--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:44:38.061316377 +0200 +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:50:27.427430853 +0200 @@ -130,14 +130,24 @@ String jvmArgLine = newJvmArgLine( forkNumber ); if ( !jvmArgLine.isEmpty() ) { - cli.createArg() - .setLine( jvmArgLine ); + try + { + cli.createArg().setLine( jvmArgLine ); + } + catch (Exception e) + { + } } if ( getDebugLine() != null && !getDebugLine().isEmpty() ) { - cli.createArg() - .setLine( getDebugLine() ); + try + { + cli.createArg().setLine( getDebugLine() ); + } + catch (Exception e) + { + } } resolveClasspath( cli, findStartClass( config ), config ); --- 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 @@ -237,6 +237,10 @@ public class StatelessXmlReporter } ppw.endElement(); // TestSuite } + catch (IOException e) + { + throw new RuntimeException(e); + } finally { closeQuietly( fw ); @@ -323,7 +327,7 @@ public class StatelessXmlReporter } private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix, - String timeAsString ) + String timeAsString ) throws IOException { ppw.startElement( "testcase" ); ppw.addAttribute( "name", report.getReportName() ); @@ -346,7 +350,7 @@ public class StatelessXmlReporter } private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats, - String timeAsString ) + String timeAsString ) throws IOException { ppw.startElement( "testsuite" ); @@ -373,7 +377,7 @@ public class StatelessXmlReporter private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, OutputStream fw, - String testErrorType, boolean createOutErrElementsInside ) + String testErrorType, boolean createOutErrElementsInside ) throws IOException { ppw.startElement( testErrorType ); @@ -418,7 +422,7 @@ public class StatelessXmlReporter // Create system-out and system-err elements private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw, - WrappedReportEntry report, OutputStream fw ) + WrappedReportEntry report, OutputStream fw ) throws IOException { EncodingOutputStream eos = new EncodingOutputStream( fw ); addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" ); @@ -428,7 +432,7 @@ public class StatelessXmlReporter private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter, EncodingOutputStream eos, XMLWriter xmlWriter, Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream, - String name ) + String name ) throws IOException { if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 ) { @@ -458,7 +462,7 @@ public class StatelessXmlReporter * * @param xmlWriter The test suite to report to */ - private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) + private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) throws IOException { xmlWriter.startElement( "properties" ); for ( final Entry entry : systemProperties.entrySet() ) --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 3.5 3.5 2.5 - 0.9 + 3.3.3 2.0.0-beta.5 scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git surefire-archives/surefire-LATEST