From 4ab8cfbccabc50ac9827395a8d3ddb5bb056b676 Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 8 Aug 2022 12:34:36 -0400 Subject: [PATCH] Import rpm: 3bca766ae561fee0b9f064ab4e5d9590adf07682 --- .fmf/version | 1 + .gitignore | 1 + 0001-Adapt-mvn-script.patch | 69 ++ 0002-Invoke-logback-via-reflection.patch | 53 ++ ...rt-MNG-6335-Update-Mockito-to-2.12.0.patch | 180 ++++ 0003-Use-non-shaded-HTTP-wagon.patch | 51 ++ 0004-Remove-dependency-on-powermock.patch | 96 +++ gating.yaml | 9 + maven-bash-completion | 90 ++ maven.spec | 778 ++++++++++++++++++ mvn.1 | 153 ++++ plans/smoke-jdk11.fmf | 8 + plans/smoke-jdk17.fmf | 8 + plans/smoke-jdk8.fmf | 8 + sources | 1 + 15 files changed, 1506 insertions(+) create mode 100644 .fmf/version create mode 100644 .gitignore create mode 100644 0001-Adapt-mvn-script.patch create mode 100644 0002-Invoke-logback-via-reflection.patch create mode 100644 0003-Revert-MNG-6335-Update-Mockito-to-2.12.0.patch create mode 100644 0003-Use-non-shaded-HTTP-wagon.patch create mode 100644 0004-Remove-dependency-on-powermock.patch create mode 100644 gating.yaml create mode 100644 maven-bash-completion create mode 100644 maven.spec create mode 100644 mvn.1 create mode 100644 plans/smoke-jdk11.fmf create mode 100644 plans/smoke-jdk17.fmf create mode 100644 plans/smoke-jdk8.fmf create mode 100644 sources diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..916ab6a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/apache-maven-3.5.4-src.tar.gz diff --git a/0001-Adapt-mvn-script.patch b/0001-Adapt-mvn-script.patch new file mode 100644 index 0000000..0b5361b --- /dev/null +++ b/0001-Adapt-mvn-script.patch @@ -0,0 +1,69 @@ +From 46041685a82b861bc8616bb603e341adb740a302 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Wed, 1 Feb 2017 14:54:26 +0100 +Subject: [PATCH 1/3] Adapt mvn script + +--- + apache-maven/src/bin/mvn | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn +index a554c66..818cf70 100755 +--- a/apache-maven/src/bin/mvn ++++ b/apache-maven/src/bin/mvn +@@ -22,7 +22,7 @@ + # + # Environment Variable Prerequisites + # +-# JAVA_HOME Must point at your Java Development Kit installation. ++# JAVA_HOME (Optional) Must point at your Java Development Kit installation. + # MAVEN_OPTS (Optional) Java runtime options used when Maven is executed. + # MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files. + # ----------------------------------------------------------------------------- +@@ -33,12 +33,24 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then + . /etc/mavenrc + fi + ++ if [ -f /etc/java/maven.conf ] ; then ++ . /etc/java/maven.conf ++ fi ++ + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + + fi + ++if [ -f /usr/share/java-utils/java-functions ] ; then ++ . /usr/share/java-utils/java-functions ++ set_jvm ++ set_javacmd ++fi ++export JAVA_HOME ++export JAVACMD ++ + # OS specific support. $var _must_ be set to either true or false. + cygwin=false; + mingw=false; +@@ -63,7 +75,8 @@ done + + saveddir=`pwd` + +-MAVEN_HOME=`dirname "$PRG"`/.. ++MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}" ++unset _FEDORA_MAVEN_HOME + + # make it fully qualified + MAVEN_HOME=`cd "$MAVEN_HOME" && pwd` +@@ -102,7 +115,7 @@ if [ ! -x "$JAVACMD" ] ; then + exit 1 + fi + +-CLASSWORLDS_JAR=`echo "${MAVEN_HOME}"/boot/plexus-classworlds-*.jar` ++CLASSWORLDS_JAR=`build-classpath plexus-classworlds` + CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + + # For Cygwin, switch paths to Windows format before running java +-- +2.17.1 + diff --git a/0002-Invoke-logback-via-reflection.patch b/0002-Invoke-logback-via-reflection.patch new file mode 100644 index 0000000..71d45e6 --- /dev/null +++ b/0002-Invoke-logback-via-reflection.patch @@ -0,0 +1,53 @@ +From 4e1e32e3a96c6876a22cca6743288b8c8df4adb0 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 6 Jun 2017 13:47:43 +0200 +Subject: [PATCH 2/3] Invoke logback via reflection + +--- + .../logging/impl/LogbackConfiguration.java | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java +index 5d9fab7..ced38cb 100644 +--- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java ++++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java +@@ -35,22 +35,31 @@ public class LogbackConfiguration + @Override + public void setRootLoggerLevel( Level level ) + { +- ch.qos.logback.classic.Level value; ++ String value; + switch ( level ) + { + case DEBUG: +- value = ch.qos.logback.classic.Level.DEBUG; ++ value = "DEBUG"; + break; + + case INFO: +- value = ch.qos.logback.classic.Level.INFO; ++ value = "INFO"; + break; + + default: +- value = ch.qos.logback.classic.Level.ERROR; ++ value = "ERROR"; + break; + } +- ( (ch.qos.logback.classic.Logger) LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME ) ).setLevel( value ); ++ Logger logger = LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME ); ++ try { ++ Class levelClass = Class.forName("ch.qos.logback.classic.Level"); ++ Object logbackLevel = levelClass.getField(value).get(null); ++ Class loggerClass = Class.forName("ch.qos.logback.classic.Logger"); ++ loggerClass.getMethod("setLevel", new Class[] {levelClass}) ++ .invoke(logger, new Object[] {logbackLevel}); ++ } catch (Exception e) { ++ throw new RuntimeException("Failed to initialize logback configuration", e); ++ } + } + + @Override +-- +2.17.1 + diff --git a/0003-Revert-MNG-6335-Update-Mockito-to-2.12.0.patch b/0003-Revert-MNG-6335-Update-Mockito-to-2.12.0.patch new file mode 100644 index 0000000..24ff301 --- /dev/null +++ b/0003-Revert-MNG-6335-Update-Mockito-to-2.12.0.patch @@ -0,0 +1,180 @@ +From 6b5e263ebd03be9551c4e6aa394ac2334fff7c03 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 13 Mar 2018 11:49:16 +0100 +Subject: [PATCH 3/3] Revert "[ MNG-6335] Update Mockito to 2.12.0" + +This reverts commit a03489b67d04a4b014ff5d1c151b331a39bf100b. +--- + .../DefaultToolchainManagerPrivateTest.java | 15 +++++++++------ + .../toolchain/DefaultToolchainManagerTest.java | 4 ++-- + .../building/DefaultToolchainsBuilderTest.java | 14 +++++++------- + maven-embedder/pom.xml | 1 - + pom.xml | 2 +- + 5 files changed, 19 insertions(+), 17 deletions(-) + +diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java +index c937564..1e48441 100644 +--- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java ++++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java +@@ -20,7 +20,8 @@ package org.apache.maven.toolchain; + */ + + import static org.junit.Assert.assertEquals; +-import static org.mockito.ArgumentMatchers.anyString; ++import static org.junit.Assert.fail; ++import static org.mockito.Matchers.anyString; + import static org.mockito.Mockito.mock; + import static org.mockito.Mockito.never; + import static org.mockito.Mockito.verify; +@@ -144,8 +145,9 @@ public class DefaultToolchainManagerPrivateTest + verify( logger, never() ).error( anyString() ); + assertEquals( 2, toolchains.length ); + } +- +- @Test ++ ++ @SuppressWarnings( "unchecked" ) ++ @Test( expected = MisconfiguredToolchainException.class ) + public void testMisconfiguredToolchain() + throws Exception + { +@@ -153,11 +155,12 @@ public class DefaultToolchainManagerPrivateTest + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest req = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( req ); ++ when(toolchainFactory_basicType.createDefaultToolchain()).thenThrow( MisconfiguredToolchainException.class ); + + // execute +- ToolchainPrivate[] basics = toolchainManager.getToolchainsForType("basic", session); +- ++ toolchainManager.getToolchainsForType( "basic", session ); ++ + // verify +- assertEquals( 0, basics.length ); ++ fail( "Should exit with a MisconfiguredToolchainException" ); + } + } +diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java +index 84444c0..6e85c42 100644 +--- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java ++++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java +@@ -20,6 +20,7 @@ package org.apache.maven.toolchain; + */ + + import static org.junit.Assert.assertEquals; ++import static org.mockito.Matchers.anyMap; + import static org.mockito.Matchers.isA; + import static org.mockito.Mockito.mock; + import static org.mockito.Mockito.verify; +@@ -38,7 +39,6 @@ import org.apache.maven.toolchain.model.ToolchainModel; + import org.codehaus.plexus.logging.Logger; + import org.junit.Before; + import org.junit.Test; +-import org.mockito.ArgumentMatchers; + import org.mockito.InjectMocks; + import org.mockito.Mock; + import org.mockito.MockitoAnnotations; +@@ -142,7 +142,7 @@ public class DefaultToolchainManagerTest + executionRequest.setToolchains( toolchainModels ); + when( session.getRequest() ).thenReturn( executionRequest ); + ToolchainPrivate basicPrivate = mock( ToolchainPrivate.class ); +- when( basicPrivate.matchesRequirements( ArgumentMatchers.anyMap() ) ).thenReturn( false ).thenReturn( true ); ++ when( basicPrivate.matchesRequirements( anyMap() ) ).thenReturn( false ).thenReturn( true ); + when( toolchainFactory_basicType.createToolchain( isA( ToolchainModel.class ) ) ).thenReturn( basicPrivate ); + + List toolchains = +diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java +index fc530df..80fca09 100644 +--- a/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java ++++ b/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java +@@ -21,7 +21,8 @@ package org.apache.maven.toolchain.building; + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.assertNotNull; +-import static org.mockito.ArgumentMatchers.any; ++import static org.mockito.Matchers.any; ++import static org.mockito.Matchers.anyMap; + import static org.mockito.Mockito.when; + + import java.io.IOException; +@@ -34,7 +35,6 @@ import org.apache.maven.toolchain.model.PersistedToolchains; + import org.apache.maven.toolchain.model.ToolchainModel; + import org.junit.Before; + import org.junit.Test; +-import org.mockito.ArgumentMatchers; + import org.mockito.InjectMocks; + import org.mockito.Mock; + import org.mockito.MockitoAnnotations; +@@ -78,7 +78,7 @@ public class DefaultToolchainsBuilderTest + toolchain.setType( "TYPE" ); + toolchain.addProvide( "key", "user_value" ); + userResult.addToolchain( toolchain ); +- when( toolchainsReader.read( any( InputStream.class ), ArgumentMatchers.anyMap()) ).thenReturn( userResult ); ++ when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( userResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); +@@ -101,7 +101,7 @@ public class DefaultToolchainsBuilderTest + toolchain.setType( "TYPE" ); + toolchain.addProvide( "key", "global_value" ); + globalResult.addToolchain( toolchain ); +- when( toolchainsReader.read( any( InputStream.class ), ArgumentMatchers.anyMap()) ).thenReturn( globalResult ); ++ when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( globalResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); +@@ -131,7 +131,7 @@ public class DefaultToolchainsBuilderTest + globalToolchain.setType( "TYPE" ); + globalToolchain.addProvide( "key", "global_value" ); + globalResult.addToolchain( globalToolchain ); +- when( toolchainsReader.read( any( InputStream.class ), ArgumentMatchers.anyMap()) ).thenReturn( globalResult ).thenReturn( userResult ); ++ when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( globalResult ).thenReturn( userResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); +@@ -150,7 +150,7 @@ public class DefaultToolchainsBuilderTest + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "" ) ); + ToolchainsParseException parseException = new ToolchainsParseException( "MESSAGE", 4, 2 ); +- when( toolchainsReader.read( any( InputStream.class ), ArgumentMatchers.anyMap()) ).thenThrow( parseException ); ++ when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenThrow( parseException ); + + try + { +@@ -169,7 +169,7 @@ public class DefaultToolchainsBuilderTest + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "", "LOCATION" ) ); + IOException ioException = new IOException( "MESSAGE" ); +- when( toolchainsReader.read( any( InputStream.class ), ArgumentMatchers.anyMap()) ).thenThrow( ioException ); ++ when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenThrow( ioException ); + + try + { +diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml +index 8a00565..2a9668b 100644 +--- a/maven-embedder/pom.xml ++++ b/maven-embedder/pom.xml +@@ -141,7 +141,6 @@ under the License. + + org.mockito + mockito-core +- test + + + org.fusesource.jansi +diff --git a/pom.xml b/pom.xml +index ef1d0b0..77b3395 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -53,7 +53,7 @@ under the License. + 1.4 + 3.5 + 4.12 +- 2.12.0 ++ 1.10.19 + 1.7.1 + 1.24 + 3.1.0 +-- +2.17.1 + diff --git a/0003-Use-non-shaded-HTTP-wagon.patch b/0003-Use-non-shaded-HTTP-wagon.patch new file mode 100644 index 0000000..d61abb3 --- /dev/null +++ b/0003-Use-non-shaded-HTTP-wagon.patch @@ -0,0 +1,51 @@ +From c8933d155694ce37b1d4be59a744c8f7cbde6bb5 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Mon, 1 Jul 2019 09:51:56 +0200 +Subject: [PATCH 4/4] Use non-shaded HTTP wagon + +--- + apache-maven/pom.xml | 15 --------------- + pom.xml | 1 - + 2 files changed, 16 deletions(-) + +diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml +index 82e12a3..f02a45e 100644 +--- a/apache-maven/pom.xml ++++ b/apache-maven/pom.xml +@@ -63,21 +63,6 @@ under the License. + + org.apache.maven.wagon + wagon-http +- shaded +- +- +- org.apache.httpcomponents +- httpclient +- +- +- org.apache.httpcomponents +- httpcore +- +- +- org.apache.maven.wagon +- wagon-http-shared +- +- + + +