From 4fd8371c98571d1e177f6709efe98dbeaf91de22 Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Thu, 26 May 2022 16:39:12 +0800 Subject: [PATCH] Resolve maven-surefire compilation fails (cherry picked from commit d54d13429ac5bb74d6b3622a01ff17f0d2922604) --- 0005-Port-to-maven-shared-utils-3.3.3.patch | 58 +++++++++++++++++++++ maven-surefire.spec | 6 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0005-Port-to-maven-shared-utils-3.3.3.patch diff --git a/0005-Port-to-maven-shared-utils-3.3.3.patch b/0005-Port-to-maven-shared-utils-3.3.3.patch new file mode 100644 index 0000000..643afd5 --- /dev/null +++ b/0005-Port-to-maven-shared-utils-3.3.3.patch @@ -0,0 +1,58 @@ +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 + diff --git a/maven-surefire.spec b/maven-surefire.spec index 3c4d360..54d9e07 100644 --- a/maven-surefire.spec +++ b/maven-surefire.spec @@ -1,7 +1,7 @@ Name: maven-surefire Epoch: 0 Version: 2.22.0 -Release: 6 +Release: 7 Summary: The test framework project of surefire License: ASL 2.0 and CPL URL: http://maven.apache.org/surefire/ @@ -12,6 +12,7 @@ Patch0000: 0001-Maven-3.patch Patch0001: 0002-Port-to-current-doxia.patch Patch0002: 0003-Port-to-TestNG-6.11.patch Patch0003: 0004-Port-to-current-maven-shared-utils.patch +Patch0004: 0005-Port-to-maven-shared-utils-3.3.3.patch BuildRequires: maven-local mvn(com.google.code.findbugs:jsr305) mvn(commons-io:commons-io) BuildRequires: mvn(junit:junit) mvn(org.apache.maven.plugins:maven-dependency-plugin) BuildRequires: mvn(org.apache.maven.doxia:doxia-site-renderer) mvn(org.testng:testng::jdk15:) @@ -131,5 +132,8 @@ sed -i /-Xdoclint:all/d pom.xml %doc cpl-v10.html %changelog +* Thu May 26 2022 yaoxin - 0:2.22.0-7 +- maven-surefire compilation fails due to maven-shared-utils update to 3.3.3 + * Mon Jun 15 2020 Jeffery.Gao - 2.22.0-6 - Package init -- Gitee