maven-surefire/0004-Port-to-maven-shared-utils-3.3.3.patch

58 lines
2.2 KiB
Diff
Raw Normal View History

2020-09-11 12:09:59 +00:00
From 980a109bd3607f1035097d6ad923f82cc58c95d2 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 11 Sep 2020 12:17:15 +0200
Subject: [PATCH] Port to maven-shared-utils 3.3.3
---
.../DefaultForkConfiguration.java | 26 ++++++++++++-------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
index fa9945123..ed75ecdff 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
@@ -42,6 +42,8 @@
import static org.apache.maven.plugin.surefire.SurefireHelper.replaceThreadNumberPlaceholders;
import static org.apache.maven.surefire.booter.Classpath.join;
+import org.apache.maven.shared.utils.cli.CommandLineException;
+
/**
* Basic framework which constructs CLI.
*
@@ -131,17 +133,21 @@ public OutputStreamFlushableCommandline createCommandLine( @Nonnull StartupConfi
cli.setExecutable( getJdkForTests().getJvmExecutable() );
- String jvmArgLine = newJvmArgLine( forkNumber );
- if ( !jvmArgLine.isEmpty() )
- {
- cli.createArg()
- .setLine( jvmArgLine );
- }
+ try {
+ String jvmArgLine = newJvmArgLine( forkNumber );
+ if ( !jvmArgLine.isEmpty() )
+ {
+ cli.createArg()
+ .setLine( jvmArgLine );
+ }
- if ( getDebugLine() != null && !getDebugLine().isEmpty() )
- {
- cli.createArg()
- .setLine( getDebugLine() );
+ if ( getDebugLine() != null && !getDebugLine().isEmpty() )
+ {
+ cli.createArg()
+ .setLine( getDebugLine() );
+ }
+ } catch (CommandLineException ex) {
+ throw new SurefireBooterForkException("", ex);
}
resolveClasspath( cli, findStartClass( config ), config, dumpLogDirectory );
--
2.26.2