Fridrich Strba 2024-04-08 14:33:36 +00:00 committed by Git OBS Bridge
parent 814bf03b98
commit ccdc1e93e1
14 changed files with 2325 additions and 2125 deletions

View File

@ -1,34 +0,0 @@
From 3bb1ab3a99b7db611b5d265701e1ba293413b027 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 5 May 2016 11:20:48 +0200
Subject: [PATCH 1/4] Maven 3
---
.../apache/maven/plugin/surefire/SurefireHelper.java | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
index dd29cb4..dc7915c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
@@ -204,16 +204,7 @@ public final class SurefireHelper
private static String getFailureBehavior( MavenExecutionRequest request )
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
{
- try
- {
- return request.getFailureBehavior();
- }
- catch ( NoSuchMethodError e )
- {
- return (String) request.getClass()
- .getMethod( "getReactorFailureBehavior" )
- .invoke( request );
- }
+ return request.getReactorFailureBehavior();
}
private static boolean failIfNoTests( SurefireReportParameters reportParameters )
--
2.17.1

View File

@ -0,0 +1,66 @@
From 2506b32ba90ef0e336f088e7aa8c12d3273ba242 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 10 Jul 2017 10:37:50 +0200
Subject: [PATCH 1/4] Port to TestNG 7.4.0
---
pom.xml | 2 +-
surefire-providers/surefire-testng/pom.xml | 1 -
.../maven/surefire/testng/conf/AbstractDirectConfigurator.java | 2 +-
.../maven/surefire/testng/conf/TestNGMapConfigurator.java | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index cb15de8f7..2f9a061e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,7 @@
<mavenSharedUtilsVersion>3.3.4</mavenSharedUtilsVersion>
<powermockVersion>2.0.9</powermockVersion>
<jacocoVersion>0.8.11</jacocoVersion>
- <testngVersion>5.11</testngVersion>
+ <testngVersion>7.4.0</testngVersion>
<surefire-shared-utils.version>${project.version}</surefire-shared-utils.version>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml
index c7633d60c..00f22400c 100644
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -56,7 +56,6 @@
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testngVersion}</version>
- <classifier>jdk15</classifier>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
index b73b9bacd..ab187b6d5 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
@@ -57,7 +57,7 @@ public void configure(TestNG testng, Map<String, String> options) throws TestSet
testng.setUseDefaultListeners(false);
configureInstance(testng, options);
// TODO: we should have the Profile so that we can decide if this is needed or not
- testng.setListenerClasses(loadListenerClasses(listeners));
+ testng.setListenerClasses((List)loadListenerClasses(listeners));
}
@Override
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index d91e76afc..06dbd2316 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -71,7 +71,7 @@ protected void configureThreadCount(XmlSuite suite, Map<String, String> options)
protected void configureParallel(XmlSuite suite, Map<String, String> options) throws TestSetFailedException {
String parallel = options.get(PARALLEL_PROP);
if (parallel != null) {
- suite.setParallel(parallel);
+ suite.setParallel(XmlSuite.ParallelMode.getValidParallel(parallel));
}
}
--
2.44.0

View File

@ -0,0 +1,111 @@
From 03b2d5ad118e287e11f576e7f03f97e05782a043 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 27 Apr 2020 10:45:30 +0200
Subject: [PATCH 2/4] Disable JUnit 4.8 test grouping
---
.../surefire/junitcore/JUnitCoreProvider.java | 21 +++------------
.../maven/surefire/testng/TestNGExecutor.java | 27 +------------------
2 files changed, 4 insertions(+), 44 deletions(-)
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
index f2f58fe81..c09c51eba 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
@@ -39,7 +39,6 @@
import org.apache.maven.surefire.common.junit4.JUnit4RunListener;
import org.apache.maven.surefire.common.junit4.JUnitTestFailureListener;
import org.apache.maven.surefire.common.junit4.Notifier;
-import org.apache.maven.surefire.common.junit48.FilterFactory;
import org.apache.maven.surefire.common.junit48.JUnit48Reflector;
import org.apache.maven.surefire.common.junit48.JUnit48TestChecker;
import org.junit.runner.Description;
@@ -50,6 +49,7 @@
import static org.apache.maven.surefire.api.report.RunMode.RERUN_TEST_AFTER_FAILURE;
import static org.apache.maven.surefire.api.testset.TestListResolver.optionallyWildcardFilter;
import static org.apache.maven.surefire.api.util.TestsToRun.fromClass;
+import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.createMatchAnyDescriptionFilter;
import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.generateFailingTestDescriptions;
import static org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners;
import static org.apache.maven.surefire.common.junit4.Notifier.pureNotifier;
@@ -118,7 +118,7 @@ public RunResult invoke(Object forkTestSet) throws TestSetFailedException {
Notifier notifier = new Notifier(listener, getSkipAfterFailureCount());
// startCapture() called in createRunListener() in prior to setTestsToRun()
- Filter filter = jUnit48Reflector.isJUnit48Available() ? createJUnit48Filter() : null;
+ Filter filter = null;
if (testsToRun == null) {
setTestsToRun(forkTestSet);
@@ -158,8 +158,7 @@ public RunResult invoke(Object forkTestSet) throws TestSetFailedException {
i++) {
Set<Description> failures = generateFailingTestDescriptions(testFailureListener.getAllFailures());
testFailureListener.reset();
- FilterFactory filterFactory = new FilterFactory(testClassLoader);
- Filter failureDescriptionFilter = filterFactory.createMatchAnyDescriptionFilter(failures);
+ Filter failureDescriptionFilter = createMatchAnyDescriptionFilter(failures);
rerunCore.execute(testsToRun, failureDescriptionFilter);
}
}
@@ -236,20 +235,6 @@ private boolean isParallelTypes() {
return jUnitCoreParameters.isParallelClasses() || jUnitCoreParameters.isParallelSuites();
}
- private Filter createJUnit48Filter() {
- final FilterFactory factory = new FilterFactory(testClassLoader);
- Map<String, String> props = providerParameters.getProviderProperties();
- Filter groupFilter = factory.canCreateGroupFilter(props) ? factory.createGroupFilter(props) : null;
- TestListResolver methodFilter = optionallyWildcardFilter(testResolver);
- boolean onlyGroups = methodFilter.isEmpty() || methodFilter.isWildcard();
- if (onlyGroups) {
- return groupFilter;
- } else {
- Filter jUnitMethodFilter = factory.createMethodFilter(methodFilter);
- return groupFilter == null ? jUnitMethodFilter : factory.and(groupFilter, jUnitMethodFilter);
- }
- }
-
private TestsToRun scanClassPath() {
TestsToRun scanned = scanResult.applyFilter(scannerFilter, testClassLoader);
return runOrderCalculator.orderTestClasses(scanned);
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
index 96e7170b9..531fe50a5 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
@@ -258,32 +258,7 @@ private static XmlMethodSelector createMethodNameFilteringSelector(TestListResol
@SuppressWarnings("checkstyle:magicnumber")
private static XmlMethodSelector createGroupMatchingSelector(Map<String, String> options)
throws TestSetFailedException {
- final String groups = options.get(ProviderParameterNames.TESTNG_GROUPS_PROP);
- final String excludedGroups = options.get(ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP);
-
- if (groups == null && excludedGroups == null) {
- return null;
- }
-
- // the class is available in the testClassPath
- final String clazzName = "org.apache.maven.surefire.testng.utils.GroupMatcherMethodSelector";
- try {
- Class<?> clazz = Class.forName(clazzName);
-
- // HORRIBLE hack, but TNG doesn't allow us to setup a method selector instance directly.
- Method method = clazz.getMethod("setGroups", String.class, String.class);
- method.invoke(null, groups, excludedGroups);
- } catch (Exception e) {
- throw new TestSetFailedException(e.getMessage(), e);
- }
-
- XmlMethodSelector xms = new XmlMethodSelector();
-
- xms.setName(clazzName);
- // looks to need a high value
- xms.setPriority(9999);
-
- return xms;
+ return null;
}
static void run(
--
2.44.0

View File

@ -1,25 +0,0 @@
From 16e1a53ff612f4a9a777e09cdc45988e9abbe2e2 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Fri, 29 Jun 2018 12:44:37 +0200
Subject: [PATCH 2/4] Port to current doxia
---
.../maven/plugins/surefire/report/SurefireReportGenerator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
index f9b9480..f142c8d 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
@@ -26,7 +26,7 @@ import java.util.Locale;
import java.util.Map;
import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributeSet;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
import org.apache.maven.reporting.MavenReportException;
--
2.17.1

View File

@ -1,34 +0,0 @@
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -51,8 +51,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
+ <version>7.4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
@@ -63,7 +63,7 @@ public void configure( TestNG testng, Map<String, String> options )
testng.setUseDefaultListeners( false );
configureInstance( testng, options );
// TODO: we should have the Profile so that we can decide if this is needed or not
- testng.setListenerClasses( loadListenerClasses( listeners ) );
+ testng.setListenerClasses( ( List ) loadListenerClasses( listeners ) );
}
@Override
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -68,7 +68,7 @@ public void configure( XmlSuite suite, Map<String, String> options )
String parallel = options.get( PARALLEL_PROP );
if ( parallel != null )
{
- suite.setParallel( parallel );
+ suite.setParallel( XmlSuite.ParallelMode.getValidParallel( parallel ) );
}
}

View File

@ -1,109 +0,0 @@
--- 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<String, String> systemProperties )
+ private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties ) throws IOException
{
xmlWriter.startElement( "properties" );
for ( final Entry<String, String> entry : systemProperties.entrySet() )
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
<!-- <shadedVersion>2.12.4</shadedVersion> commented out due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
<commonsLang3Version>3.5</commonsLang3Version>
<commonsIoVersion>2.5</commonsIoVersion>
- <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.3.3</mavenSharedUtilsVersion>
<powermockVersion>2.0.0-beta.5</powermockVersion>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>

View File

@ -2,7 +2,7 @@
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/apache/maven-surefire.git</param>
<param name="revision">surefire-2.22.2</param>
<param name="revision">surefire-3.2.5</param>
<param name="match-tag">surefire-*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">surefire-(.*)</param>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a39d9fed069540a62a0be2ad546aec91104df541122821f8ed7d40a7418948fe
size 703876

BIN
maven-surefire-3.2.5.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
maven-surefire-build.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@ -18,7 +18,7 @@
%global base_name maven-surefire
Name: %{base_name}-plugins
Version: 2.22.2
Version: 3.2.5
Release: 0
Summary: Test framework project
License: Apache-2.0 AND CPL-1.0
@ -27,34 +27,29 @@ URL: https://maven.apache.org/surefire/
Source0: %{base_name}-%{version}.tar.xz
Source1: https://www.apache.org/licenses/LICENSE-2.0.txt
Source2: https://www.eclipse.org/legal/cpl-v10.html
Patch0: 0001-Maven-3.patch
Patch1: 0002-Port-to-current-doxia.patch
Patch2: 0003-Port-to-TestNG-7.4.0.patch
Patch3: 0004-Port-to-current-maven-shared-utils.patch
Patch0: 0001-Port-to-TestNG-7.4.0.patch
Patch1: 0002-Disable-JUnit-4.8-test-grouping.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.maven.doxia:doxia-site-renderer)
BuildRequires: mvn(org.apache.maven.doxia:doxia-core)
BuildRequires: mvn(org.apache.maven.doxia:doxia-sink-api)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-api)
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl)
BuildRequires: mvn(org.apache.maven.shared:maven-shared-utils)
BuildRequires: mvn(org.apache.maven.surefire:maven-surefire-common)
BuildRequires: mvn(org.apache.maven.surefire:surefire-logger-api)
BuildRequires: mvn(org.apache.maven.surefire:surefire-report-parser)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-model)
BuildRequires: mvn(org.apache.maven:maven-parent:pom:)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.codehaus.plexus:plexus-xml)
BuildRequires: mvn(org.fusesource.jansi:jansi)
#!BuildRequires: maven-compiler-plugin-bootstrap
#!BuildRequires: maven-jar-plugin-bootstrap
#!BuildRequires: maven-javadoc-plugin-bootstrap
#!BuildRequires: maven-plugin-plugin-bootstrap
#!BuildRequires: maven-resources-plugin-bootstrap
#!BuildRequires: maven-surefire-plugin-bootstrap
BuildArch: noarch
%description
@ -108,57 +103,47 @@ cp -p %{SOURCE1} %{SOURCE2} .
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
# Disable strict doclint
sed -i /-Xdoclint:all/d pom.xml
%pom_remove_dep org.junit:junit-bom
%pom_disable_module surefire-shadefire
%pom_remove_dep -r org.apache.maven.surefire:surefire-shadefire
# Help plugin is needed only to evaluate effective Maven settings.
# For building RPM package default settings will suffice.
%pom_remove_plugin :maven-help-plugin surefire-its
# QA plugin useful only for upstream
%pom_remove_plugin -r :jacoco-maven-plugin
# Not wanted
%pom_remove_plugin -r :maven-shade-plugin
# Not in Fedora
find -name *.java -exec sed -i -e s/org.apache.maven.surefire.shared.utils/org.apache.maven.shared.utils/ -e s/org.apache.maven.surefire.shared.io/org.apache.commons.io/ -e s/org.apache.maven.surefire.shared.lang3/org.apache.commons.lang3/ -e s/org.apache.maven.surefire.shared.compress/org.apache.commons.compress/ {} \;
# Not packaged
%pom_remove_plugin -r :animal-sniffer-maven-plugin
# Complains
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-enforcer-plugin
# We don't need site-source
%pom_remove_plugin :maven-assembly-plugin maven-surefire-plugin
%pom_remove_dep -r ::::site-source
%pom_xpath_set pom:mavenVersion 3.3.3
%pom_remove_dep :maven-project maven-surefire-report-plugin
%pom_remove_dep :maven-project maven-surefire-common
%pom_remove_dep :maven-plugin-descriptor maven-surefire-common
%pom_remove_dep :maven-toolchain maven-surefire-common
%pom_xpath_remove -r "pom:execution[pom:id='shared-logging-generated-sources']"
%pom_add_dep com.google.code.findbugs:jsr305 surefire-api
%pom_remove_plugin -r :maven-shade-plugin
%pom_remove_plugin -r :build-helper-maven-plugin
find . -name dependency-reduced-pom.xml -delete
%pom_add_dep org.apache.commons:commons-lang3::runtime maven-surefire-plugin
%pom_add_dep commons-io:commons-io::runtime maven-surefire-plugin
%pom_xpath_inject pom:project/pom:properties "
<mavenPluginToolsVersion>3.5.2</mavenPluginToolsVersion>"
# Disable all modules besides the 3 plugins
for module in \
surefire-logger-api \
surefire-api \
surefire-shadefire \
surefire-booter \
surefire-grouper \
surefire-providers \
maven-surefire-common \
surefire-report-parser \
surefire-its; do
surefire-api \
surefire-booter \
surefire-extensions-api \
surefire-extensions-spi \
surefire-grouper \
surefire-its \
surefire-logger-api \
surefire-providers \
surefire-shared-utils \
surefire-report-parser; do
%pom_disable_module ${module}
done

View File

@ -18,7 +18,7 @@
%global base_name maven-surefire
Name: %{base_name}-provider-junit5
Version: 2.22.2
Version: 3.2.5
Release: 0
Summary: JUnit 5 provider for Maven Surefire
License: Apache-2.0 AND CPL-1.0
@ -27,16 +27,13 @@ URL: https://maven.apache.org/surefire/
Source0: %{base_name}-%{version}.tar.xz
Source1: https://www.apache.org/licenses/LICENSE-2.0.txt
Source2: https://www.eclipse.org/legal/cpl-v10.html
Patch0: 0001-Maven-3.patch
Patch1: 0002-Port-to-current-doxia.patch
Patch2: 0003-Port-to-TestNG-7.4.0.patch
Patch3: 0004-Port-to-current-maven-shared-utils.patch
Patch0: 0001-Port-to-TestNG-7.4.0.patch
Patch1: 0002-Disable-JUnit-4.8-test-grouping.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.surefire:common-java5)
BuildRequires: mvn(org.apache.maven:maven-parent:pom:)
BuildRequires: mvn(org.apiguardian:apiguardian-api)
BuildRequires: mvn(org.junit.platform:junit-platform-launcher)
# PpidChecker relies on /usr/bin/ps to check process uptime
Requires: procps
@ -58,46 +55,34 @@ cp -p %{SOURCE1} %{SOURCE2} .
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
# Disable strict doclint
sed -i /-Xdoclint:all/d pom.xml
%pom_remove_dep org.junit:junit-bom
%pom_disable_module surefire-shadefire
%pom_add_dep org.apiguardian:apiguardian-api::provided surefire-providers/surefire-junit-platform
%pom_remove_dep -r org.apache.maven.surefire:surefire-shadefire
# Help plugin is needed only to evaluate effective Maven settings.
# For building RPM package default settings will suffice.
%pom_remove_plugin :maven-help-plugin surefire-its
# QA plugin useful only for upstream
%pom_remove_plugin -r :jacoco-maven-plugin
# Not wanted
%pom_remove_plugin -r :maven-shade-plugin
# Not in Fedora
find -name *.java -exec sed -i -e s/org.apache.maven.surefire.shared.utils/org.apache.maven.shared.utils/ -e s/org.apache.maven.surefire.shared.io/org.apache.commons.io/ -e s/org.apache.maven.surefire.shared.lang3/org.apache.commons.lang3/ -e s/org.apache.maven.surefire.shared.compress/org.apache.commons.compress/ {} \;
# Not packaged
%pom_remove_plugin -r :animal-sniffer-maven-plugin
# Complains
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-enforcer-plugin
# We don't need site-source
%pom_remove_plugin :maven-assembly-plugin maven-surefire-plugin
%pom_remove_dep -r ::::site-source
%pom_xpath_set pom:mavenVersion 3.3.3
%pom_remove_dep :maven-project maven-surefire-report-plugin
%pom_remove_dep :maven-project maven-surefire-common
%pom_remove_dep :maven-plugin-descriptor maven-surefire-common
%pom_remove_dep :maven-toolchain maven-surefire-common
%pom_xpath_remove -r "pom:execution[pom:id='shared-logging-generated-sources']"
%pom_add_dep com.google.code.findbugs:jsr305 surefire-api
%pom_remove_plugin -r :maven-shade-plugin
%pom_remove_plugin -r :build-helper-maven-plugin
%pom_add_dep org.apache.commons:commons-lang3::runtime maven-surefire-plugin
%pom_add_dep commons-io:commons-io::runtime maven-surefire-plugin
%build
pushd surefire-providers/surefire-junit-platform
%{mvn_build} -f -- \

View File

@ -17,7 +17,7 @@
Name: maven-surefire
Version: 2.22.2
Version: 3.2.5
Release: 0
Summary: Test framework project
License: Apache-2.0 AND CPL-1.0
@ -27,18 +27,22 @@ Source0: %{name}-%{version}.tar.xz
Source1: https://www.apache.org/licenses/LICENSE-2.0.txt
Source2: https://www.eclipse.org/legal/cpl-v10.html
Source10: %{name}-build.tar.xz
Patch0: 0001-Maven-3.patch
Patch1: 0002-Port-to-current-doxia.patch
Patch2: 0003-Port-to-TestNG-7.4.0.patch
Patch3: 0004-Port-to-current-maven-shared-utils.patch
Patch0: 0001-Port-to-TestNG-7.4.0.patch
Patch1: 0002-Disable-JUnit-4.8-test-grouping.patch
Patch10: %{name}-bootstrap-resources.patch
BuildRequires: ant
BuildRequires: apache-commons-cli
BuildRequires: apache-commons-compress
BuildRequires: apache-commons-io
BuildRequires: apache-commons-lang3
BuildRequires: atinject
BuildRequires: fdupes
BuildRequires: google-guice
BuildRequires: guava
BuildRequires: java-devel >= 1.8
BuildRequires: javacc
BuildRequires: javapackages-local
BuildRequires: jdom
BuildRequires: jsr-305
BuildRequires: junit
BuildRequires: maven-common-artifact-filters
@ -50,9 +54,19 @@ BuildRequires: maven-lib
BuildRequires: maven-plugin-annotations
BuildRequires: maven-reporting-api
BuildRequires: maven-reporting-impl
BuildRequires: maven-resolver
BuildRequires: maven-shared-utils
BuildRequires: objectweb-asm
BuildRequires: plexus-classworlds
BuildRequires: plexus-cli
BuildRequires: plexus-i18n
BuildRequires: plexus-interpolation
BuildRequires: plexus-languages
BuildRequires: plexus-metadata-generator
BuildRequires: plexus-utils
BuildRequires: plexus-xml
BuildRequires: qdox
BuildRequires: sisu-inject
BuildRequires: sisu-plexus
BuildRequires: testng
BuildRequires: xmvn-install
@ -134,47 +148,35 @@ cp -p %{SOURCE1} %{SOURCE2} .
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 10 -p1
# Disable strict doclint
sed -i /-Xdoclint:all/d pom.xml
%pom_remove_dep org.junit:junit-bom
%pom_disable_module surefire-shadefire
%pom_disable_module surefire-junit-platform surefire-providers
%pom_remove_dep -r org.apache.maven.surefire:surefire-shadefire
# Help plugin is needed only to evaluate effective Maven settings.
# For building RPM package default settings will suffice.
%pom_remove_plugin :maven-help-plugin surefire-its
# QA plugin useful only for upstream
%pom_remove_plugin -r :jacoco-maven-plugin
# Not wanted
%pom_remove_plugin -r :maven-shade-plugin
# Not in Fedora
find -name *.java -exec sed -i -e s/org.apache.maven.surefire.shared.utils/org.apache.maven.shared.utils/ -e s/org.apache.maven.surefire.shared.io/org.apache.commons.io/ -e s/org.apache.maven.surefire.shared.lang3/org.apache.commons.lang3/ -e s/org.apache.maven.surefire.shared.compress/org.apache.commons.compress/ {} \;
# Not packaged
%pom_remove_plugin -r :animal-sniffer-maven-plugin
# Complains
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-enforcer-plugin
# We don't need site-source
%pom_remove_plugin :maven-assembly-plugin maven-surefire-plugin
%pom_remove_dep -r ::::site-source
%pom_xpath_set pom:mavenVersion 3.3.3
%pom_remove_dep :maven-project maven-surefire-report-plugin
%pom_remove_dep :maven-project maven-surefire-common
%pom_remove_dep :maven-plugin-descriptor maven-surefire-common
%pom_remove_dep :maven-toolchain maven-surefire-common
%pom_xpath_remove -r "pom:execution[pom:id='shared-logging-generated-sources']"
%pom_add_dep com.google.code.findbugs:jsr305 surefire-api
%pom_remove_plugin -r :maven-shade-plugin
%pom_remove_plugin -r :build-helper-maven-plugin
%pom_add_dep org.apache.commons:commons-lang3::runtime maven-surefire-plugin
%pom_add_dep commons-io:commons-io::runtime maven-surefire-plugin
%build
%{mvn_package} ":*tests*" __noinstall
%{mvn_package} ":{surefire,surefire-providers}" __noinstall
@ -184,9 +186,15 @@ sed -i /-Xdoclint:all/d pom.xml
mkdir -p lib
build-jar-repository -s -p lib \
atinject \
apache-commons-lang3 \
commons-cli \
commons-compress \
commons-io \
guava/guava \
guice/google-guice \
javacc \
jdom2/jdom2 \
jsr-305 \
junit \
maven-common-artifact-filters/maven-common-artifact-filters \
@ -199,13 +207,26 @@ build-jar-repository -s -p lib \
maven/maven-core \
maven/maven-model \
maven/maven-plugin-api \
maven/maven-settings \
maven-plugin-tools/maven-plugin-annotations \
maven-reporting-api/maven-reporting-api \
maven-reporting-impl/maven-reporting-impl \
maven-resolver/maven-resolver-api \
maven-resolver/maven-resolver-util \
maven-shared-utils/maven-shared-utils \
objectweb-asm/asm \
org.eclipse.sisu.plexus \
org.eclipse.sisu.inject \
plexus-classworlds \
plexus/cli \
plexus-containers/plexus-component-annotations \
plexus-i18n/plexus-i18n \
plexus/interpolation \
plexus-languages/plexus-java \
plexus-metadata-generator \
plexus/utils \
plexus/xml \
qdox \
testng
%{ant} \
@ -222,6 +243,9 @@ for module in \
surefire-api \
surefire-booter \
surefire-grouper \
surefire-extensions-api \
surefire-extensions-spi \
surefire-shared-utils \
maven-surefire-common \
surefire-report-parser \
maven-surefire-plugin \