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

59 lines
2.1 KiB
Diff
Raw Normal View History

From 3b57ce4a3f7117c9750b8846e6a615f6327f0e4e Mon Sep 17 00:00:00 2001
From: starlet-dx <15929766099@163.com>
Date: Thu, 26 May 2022 09:37:40 +0800
Subject: [PATCH 1/1] Port to maven-shared-utils 3.3.3
---
.../DefaultForkConfiguration.java | 28 +++++++++++--------
1 file changed, 17 insertions(+), 11 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 c35d01c..0bf1170 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.util.Relocator.relocate;
import static org.apache.maven.surefire.booter.Classpath.join;
+import org.apache.maven.shared.utils.cli.CommandLineException;
+
/**
* Basic framework which constructs CLI.
*
@@ -127,17 +129,21 @@ public OutputStreamFlushableCommandline createCommandLine( @Nonnull StartupConfi
cli.setExecutable( getJdkForTests().getJvmExecutable() );
- String jvmArgLine = newJvmArgLine( forkNumber );
- if ( !jvmArgLine.isEmpty() )
- {
- cli.createArg()
- .setLine( jvmArgLine );
- }
-
- if ( getDebugLine() != null && !getDebugLine().isEmpty() )
- {
- cli.createArg()
- .setLine( getDebugLine() );
+ try {
+ String jvmArgLine = newJvmArgLine( forkNumber );
+ if ( !jvmArgLine.isEmpty() )
+ {
+ cli.createArg()
+ .setLine( jvmArgLine );
+ }
+
+ if ( getDebugLine() != null && !getDebugLine().isEmpty() )
+ {
+ cli.createArg()
+ .setLine( getDebugLine() );
+ }
+ } catch (CommandLineException ex) {
+ throw new SurefireBooterForkException("", ex);
}
resolveClasspath( cli, findStartClass( config ), config );
--
2.30.0