Compare commits

...

No commits in common. 'c9' and 'c8-stream-201801' have entirely different histories.

2
.gitignore vendored

@ -1 +1 @@
SOURCES/apache-maven-3.6.3-src.tar.gz
SOURCES/apache-maven-3.5.4-src.tar.gz

@ -1 +1 @@
ccf441f3bf7f477301ebc80742cbda1da73c30a2 SOURCES/apache-maven-3.6.3-src.tar.gz
04aefb9462af8cf7ca93808cd246f4c28b8ae4a1 SOURCES/apache-maven-3.5.4-src.tar.gz

@ -1,14 +1,14 @@
From 247eafd819d6092661ebc57c54815acd20abd3de Mon Sep 17 00:00:00 2001
From 46041685a82b861bc8616bb603e341adb740a302 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 1 Feb 2017 14:54:26 +0100
Subject: [PATCH 1/4] Adapt mvn script
Subject: [PATCH 1/3] Adapt mvn script
---
apache-maven/src/bin/mvn | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
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 a554c6617..739501af4 100755
index a554c66..818cf70 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -22,7 +22,7 @@
@ -20,11 +20,11 @@ index a554c6617..739501af4 100755
# 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,18 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
@@ -33,12 +33,24 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
. /etc/mavenrc
fi
+ if [ -z "$JAVA_HOME" ] ; then
+ if [ -f /etc/java/maven.conf ] ; then
+ . /etc/java/maven.conf
+ fi
+
@ -34,12 +34,18 @@ index a554c6617..739501af4 100755
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 +67,8 @@ done
@@ -63,7 +75,8 @@ done
saveddir=`pwd`
@ -49,6 +55,15 @@ index a554c6617..739501af4 100755
# 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.21.0
2.17.1

@ -1,17 +1,17 @@
From 7610a10691e680db00edcbd4ce6767a30641cd71 Mon Sep 17 00:00:00 2001
From 4e1e32e3a96c6876a22cca6743288b8c8df4adb0 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 6 Jun 2017 13:47:43 +0200
Subject: [PATCH 2/4] Invoke logback via reflection
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 5d9fab744..ced38cb5a 100644
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 @@
@@ -35,22 +35,31 @@ public class LogbackConfiguration
@Override
public void setRootLoggerLevel( Level level )
{
@ -49,5 +49,5 @@ index 5d9fab744..ced38cb5a 100644
@Override
--
2.21.0
2.17.1

@ -0,0 +1,180 @@
From 6b5e263ebd03be9551c4e6aa394ac2334fff7c03 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
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.<String, String>anyMap() ) ).thenReturn( false ).thenReturn( true );
+ when( basicPrivate.matchesRequirements( anyMap() ) ).thenReturn( false ).thenReturn( true );
when( toolchainFactory_basicType.createToolchain( isA( ToolchainModel.class ) ) ).thenReturn( basicPrivate );
List<Toolchain> 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.<String, Object>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.<String, Object>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.<String, Object>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.<String, Object>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.<String, Object>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.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
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.
<commonsCliVersion>1.4</commonsCliVersion>
<commonsLangVersion>3.5</commonsLangVersion>
<junitVersion>4.12</junitVersion>
- <mockitoVersion>2.12.0</mockitoVersion>
+ <mockitoVersion>1.10.19</mockitoVersion>
<plexusVersion>1.7.1</plexusVersion>
<plexusInterpolationVersion>1.24</plexusInterpolationVersion>
<plexusUtilsVersion>3.1.0</plexusUtilsVersion>
--
2.17.1

@ -1,51 +0,0 @@
From c8933d155694ce37b1d4be59a744c8f7cbde6bb5 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
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.
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
- <classifier>shaded</classifier>
- <exclusions>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http-shared</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<!-- this is included in Wagon Http
diff --git a/pom.xml b/pom.xml
index 44e287a..cdef69c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -328,7 +328,6 @@ under the License.
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagonVersion}</version>
- <classifier>shaded</classifier>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
--
2.24.1

@ -1,96 +0,0 @@
From f6eb583525c7f777bde16182c57a47345fd53cb0 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 5 Sep 2019 15:21:04 +0200
Subject: [PATCH] Remove dependency on powermock
---
.../StringSearchModelInterpolatorTest.java | 66 -------------------
1 file changed, 66 deletions(-)
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
index 45800d6..fbf3b23 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
@@ -36,8 +36,6 @@ import java.util.concurrent.FutureTask;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-import static org.powermock.reflect.Whitebox.getField;
-import static org.powermock.reflect.Whitebox.getInternalState;
/**
* @author jdcasey
@@ -374,70 +372,6 @@ public class StringSearchModelInterpolatorTest
) ) );
}
- public void testNotInterpolateObjectWithFile()
- throws Exception
- {
- Model model = new Model();
-
- File baseDir = new File( System.getProperty( "user.dir" ) );
-
- Properties p = new Properties();
-
- ObjectWithNotInterpolatedFile obj = new ObjectWithNotInterpolatedFile( baseDir );
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest( p );
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject( obj, model, new File( "." ), config, collector );
- assertProblemFree( collector );
-
- //noinspection unchecked
- Map<Class<?>, ?> cache =
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
- .get( null );
-
- Object objCacheItem = cache.get( Object.class );
- Object fileCacheItem = cache.get( File.class );
-
- assertNotNull( objCacheItem );
- assertNotNull( fileCacheItem );
-
- assertThat( ( (Object[]) getInternalState( objCacheItem, "fields" ) ).length, is( 0 ) );
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
- }
-
- public void testNotInterpolateFile()
- throws Exception
- {
- Model model = new Model();
-
- File baseDir = new File( System.getProperty( "user.dir" ) );
-
- Properties p = new Properties();
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest( p );
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject( baseDir, model, new File( "." ), config, collector );
- assertProblemFree( collector );
-
- //noinspection unchecked
- Map<Class<?>, ?> cache =
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
- .get( null );
-
- Object fileCacheItem = cache.get( File.class );
-
- assertNotNull( fileCacheItem );
-
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
- }
-
-
public void testConcurrentInterpolation()
throws Exception
{
--
2.24.1

@ -1,21 +1,21 @@
%bcond_with bootstrap
%bcond_without logback
%global bundled_slf4j_version 1.7.30
%global bundled_slf4j_version 1.7.25
%global homedir %{_datadir}/%{name}%{?maven_version_suffix}
%global confdir %{_sysconfdir}/%{name}%{?maven_version_suffix}
Name: maven
Epoch: 1
Version: 3.6.3
Release: 19%{?dist}
Version: 3.5.4
Release: 5%{?dist}
Summary: Java project management and project comprehension tool
# maven itself is ASL 2.0
# bundled slf4j is MIT
License: ASL 2.0 and MIT
URL: https://maven.apache.org/
URL: http://maven.apache.org/
BuildArch: noarch
Source0: https://archive.apache.org/dist/%{name}/%{name}-3/%{version}/source/apache-%{name}-%{version}-src.tar.gz
Source0: http://archive.apache.org/dist/%{name}/%{name}-3/%{version}/source/apache-%{name}-%{version}-src.tar.gz
Source1: maven-bash-completion
Source2: mvn.1
@ -23,13 +23,11 @@ Patch1: 0001-Adapt-mvn-script.patch
# Downstream-specific, avoids dependency on logback
# Used only when %%without logback is in effect
Patch2: 0002-Invoke-logback-via-reflection.patch
Patch3: 0003-Use-non-shaded-HTTP-wagon.patch
Patch4: 0004-Remove-dependency-on-powermock.patch
# We don't have mockito 2 yet
Patch3: 0003-Revert-MNG-6335-Update-Mockito-to-2.12.0.patch
BuildRequires: maven-local-openjdk8
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(com.google.guava:guava:20.0)
BuildRequires: mvn(com.google.inject:guice::no_aop:)
BuildRequires: mvn(commons-cli:commons-cli)
BuildRequires: mvn(commons-jxpath:commons-jxpath)
@ -40,7 +38,6 @@ BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.maven:maven-parent:pom:)
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-failsafe-plugin)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-api)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-connector-basic)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-impl)
@ -49,7 +46,7 @@ BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-transport-wagon)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-util)
BuildRequires: mvn(org.apache.maven.shared:maven-shared-utils)
BuildRequires: mvn(org.apache.maven.wagon:wagon-file)
BuildRequires: mvn(org.apache.maven.wagon:wagon-http)
BuildRequires: mvn(org.apache.maven.wagon:wagon-http::shaded:)
BuildRequires: mvn(org.apache.maven.wagon:wagon-provider-api)
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
@ -68,113 +65,107 @@ BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildRequires: mvn(org.sonatype.plexus:plexus-cipher)
BuildRequires: mvn(org.sonatype.plexus:plexus-sec-dispatcher)
BuildRequires: mvn(org.xmlunit:xmlunit-core)
BuildRequires: mvn(org.xmlunit:xmlunit-matchers)
%endif
# XXX
#BuildRequires: mvn(org.slf4j:slf4j-simple::sources:) = %{bundled_slf4j_version}
%if %{without bootstrap}
BuildRequires: mvn(org.slf4j:slf4j-simple::sources:)
%endif
BuildRequires: mvn(xmlunit:xmlunit)
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
Requires: %{name}-jdk-binding = %{epoch}:%{version}-%{release}
Suggests: %{name}-openjdk17 = %{epoch}:%{version}-%{release}
BuildRequires: slf4j-sources = %{bundled_slf4j_version}
Requires: which
%if %{with logback}
BuildRequires: mvn(ch.qos.logback:logback-classic)
%endif
Requires(post): alternatives
Requires(postun): alternatives
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
Requires(post): chkconfig
Requires(postun): chkconfig
# Theoretically Maven might be usable with just JRE, but typical Maven
# workflow requires full JDK, so we recommend it here.
%{?fedora:Recommends}%{!?fedora:Requires}: java-devel
# XMvn does generate auto-requires, but explicit requires are still
# needed because some symlinked JARs are not present in Maven POMs or
# their dependency scope prevents them from being added automatically
# by XMvn. It would be possible to explicitly specify only
# dependencies which are not generated automatically, but adding
# everything seems to be easier.
Requires: aopalliance
Requires: apache-commons-cli
Requires: apache-commons-codec
Requires: apache-commons-io
Requires: apache-commons-lang3
Requires: apache-commons-logging
Requires: atinject
Requires: cdi-api
Requires: geronimo-annotation
Requires: google-guice
Requires: guava20
Requires: hawtjni-runtime
Requires: httpcomponents-client
Requires: httpcomponents-core
Requires: jansi
Requires: jansi-native
Requires: jcl-over-slf4j
Requires: maven-resolver-api
Requires: maven-resolver-connector-basic
Requires: maven-resolver-impl
Requires: maven-resolver-spi
Requires: maven-resolver-transport-wagon
Requires: maven-resolver-util
Requires: maven-shared-utils
Requires: maven-wagon-file
Requires: maven-wagon-http
Requires: maven-wagon-http-shared
Requires: maven-wagon-provider-api
Requires: plexus-cipher
Requires: plexus-classworlds
Requires: plexus-containers-component-annotations
Requires: plexus-interpolation
Requires: plexus-sec-dispatcher
Requires: plexus-utils
Requires: sisu-inject
Requires: sisu-plexus
Requires: slf4j
%description
Maven is a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build,
reporting and documentation from a central piece of information.
%package lib
%package lib
Summary: Core part of Maven
# If XMvn is part of the same RPM transaction then it should be
# installed first to avoid triggering rhbz#1014355.
OrderWithRequires: xmvn-minimal
# Require full javapackages-tools since maven-script uses
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
# Maven upstream uses patched version of SLF4J. They unpack
# slf4j-simple-sources.jar, apply non-upstreamable, Maven-specific
# patch (using a script written in Groovy), compile and package as
# maven-slf4j-provider.jar, together with Maven-specific additions.
Provides: bundled(slf4j) = %{bundled_slf4j_version}
%description lib
%description lib
Core part of Apache Maven that can be used as a library.
%package openjdk8
Summary: OpenJDK 8 binding for Maven
RemovePathPostfixes: -openjdk8
Provides: maven-jdk-binding = %{epoch}:%{version}-%{release}
Requires: maven = %{epoch}:%{version}-%{release}
Requires: java-1.8.0-openjdk-headless
Recommends: java-1.8.0-openjdk-devel
Conflicts: maven-jdk-binding
%description openjdk8
Configures Maven to run with OpenJDK 8.
%package openjdk11
Summary: OpenJDK 11 binding for Maven
RemovePathPostfixes: -openjdk11
Provides: maven-jdk-binding = %{epoch}:%{version}-%{release}
Requires: maven = %{epoch}:%{version}-%{release}
Requires: java-11-openjdk-headless
Recommends: java-11-openjdk-devel
Conflicts: maven-jdk-binding
%description openjdk11
Configures Maven to run with OpenJDK 11.
%package openjdk17
Summary: OpenJDK 17 binding for Maven
RemovePathPostfixes: -openjdk17
Provides: maven-jdk-binding = %{epoch}:%{version}-%{release}
Requires: maven = %{epoch}:%{version}-%{release}
Requires: java-17-openjdk-headless
Recommends: java-17-openjdk-devel
Conflicts: maven-jdk-binding
%description openjdk17
Configures Maven to run with OpenJDK 17.
%package openjdk21
Summary: OpenJDK 21 binding for Maven
RemovePathPostfixes: -openjdk21
Provides: maven-jdk-binding = %{epoch}:%{version}-%{release}
Requires: maven = %{epoch}:%{version}-%{release}
Requires: java-21-openjdk-headless
Recommends: java-21-openjdk-devel
Conflicts: maven-jdk-binding
%description openjdk21
Configures Maven to run with OpenJDK 21.
%{?javadoc_package}
%package javadoc
Summary: API documentation for %{name}
%description javadoc
%{summary}.
%prep
%setup -q -n apache-%{name}-%{version}
find -name '*.java' -exec sed -i 's/\r//' {} +
find -name 'pom.xml' -exec sed -i 's/\r//' {} +
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch1 -p1
%patch3 -p1
# not really used during build, but a precaution
find -name '*.jar' -not -path '*/test/*' -delete
find -name '*.class' -delete
find -name '*.bat' -delete
%pom_remove_dep -r :powermock-reflect
sed -i 's:\r::' apache-maven/src/conf/settings.xml
# Downloads dependency licenses from the Internet and aggregates them.
@ -196,17 +187,13 @@ sed -i "
%mvn_package :apache-maven __noinstall
%pom_change_dep :jansi :::runtime maven-embedder
%if %{without logback}
%pom_remove_dep -r :logback-classic
%patch2 -p1
%endif
%mvn_alias :maven-resolver-provider :maven-aether-provider
%pom_xpath_inject 'pom:build/pom:plugins' '
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>' maven-model-builder/pom.xml
%build
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
@ -226,12 +213,18 @@ install -d -m 755 %{buildroot}%{confdir}
install -d -m 755 %{buildroot}%{_datadir}/bash-completion/completions/
cp -a $M2_HOME/{bin,lib,boot} %{buildroot}%{homedir}/
%if %{without bootstrap}
xmvn-subst -s -R %{buildroot} -s %{buildroot}%{homedir}
%endif
xmvn-subst -R %{buildroot} -s %{buildroot}%{homedir}
# Transitive deps of wagon-http, missing because of unshading
build-jar-repository -s -p %{buildroot}%{homedir}/lib \
commons-{codec,logging} httpcomponents/{httpclient,httpcore} maven-wagon/http-shared
# maven uses this hardcoded path in its launcher to locate jansi so we symlink it
ln -s %{_prefix}/lib/jansi/libjansi.so %{buildroot}%{homedir}/lib/jansi-native/
# Transitive deps of cdi-api that should have been excluded
rm %{buildroot}%{homedir}/lib/jboss-interceptors*.jar
rm %{buildroot}%{homedir}/lib/javax.el-api*.jar
# Native lib whose extraction we suppressed
ln -s %{_jnidir}/jansi-native/jansi-linux.jar %{buildroot}%{homedir}/lib/
install -p -m 644 %{SOURCE2} %{buildroot}%{homedir}/bin/
gzip -9 %{buildroot}%{homedir}/bin/mvn.1
@ -249,21 +242,6 @@ install -d -m 755 %{buildroot}%{_mandir}/man1/
touch %{buildroot}%{_bindir}/{mvn,mvnDebug}
touch %{buildroot}%{_mandir}/man1/{mvn,mvnDebug}.1
# Versioned commands and manpages
%if 0%{?maven_version_suffix:1}
ln -s %{homedir}/bin/mvn %{buildroot}%{_bindir}/mvn%{maven_version_suffix}
ln -s %{homedir}/bin/mvnDebug %{buildroot}%{_bindir}/mvnDebug%{maven_version_suffix}
ln -s %{homedir}/bin/mvn.1.gz %{buildroot}%{_mandir}/man1/mvn%{maven_version_suffix}.1.gz
ln -s %{homedir}/bin/mvnDebug.1.gz %{buildroot}%{_mandir}/man1/mvnDebug%{maven_version_suffix}.1.gz
%endif
# JDK bindings
install -d -m 755 %{buildroot}%{_javaconfdir}/
echo JAVA_HOME=%{_jvmlibdir}/jre-1.8.0-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk8
echo JAVA_HOME=%{_jvmlibdir}/jre-11-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk11
echo JAVA_HOME=%{_jvmlibdir}/jre-17-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk17
echo JAVA_HOME=%{_jvmlibdir}/jre-21-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk21
%post
update-alternatives --install %{_bindir}/mvn mvn %{homedir}/bin/mvn %{?maven_alternatives_priority}0 \
@ -272,13 +250,13 @@ update-alternatives --install %{_bindir}/mvn mvn %{homedir}/bin/mvn %{?maven_alt
--slave %{_mandir}/man1/mvnDebug.1.gz mvnDebug1 %{homedir}/bin/mvn.1.gz \
%postun
if [[ $1 -eq 0 ]]; then update-alternatives --remove mvn %{homedir}/bin/mvn; fi
[[ $1 -eq 0 ]] && update-alternatives --remove %{name} %{homedir}/bin/mvn
%files lib -f .mfiles
%doc README.md
%license LICENSE NOTICE
%{homedir}
%exclude %{homedir}/bin/mvn*
%dir %{confdir}
%dir %{confdir}/logging
%config(noreplace) %{_sysconfdir}/m2%{?maven_version_suffix}.conf
@ -286,185 +264,17 @@ if [[ $1 -eq 0 ]]; then update-alternatives --remove mvn %{homedir}/bin/mvn; fi
%config(noreplace) %{confdir}/logging/simplelogger.properties
%files
%{homedir}/bin/mvn*
%ghost %{_bindir}/mvn
%ghost %{_bindir}/mvnDebug
%{_datadir}/bash-completion
%ghost %{_mandir}/man1/mvn.1.gz
%ghost %{_mandir}/man1/mvnDebug.1.gz
%if 0%{?maven_version_suffix:1}
%{_bindir}/mvn%{maven_version_suffix}
%{_bindir}/mvnDebug%{maven_version_suffix}
%{_mandir}/man1/mvn%{maven_version_suffix}.1.gz
%{_mandir}/man1/mvnDebug%{maven_version_suffix}.1.gz
%endif
%files openjdk8
%config %{_javaconfdir}/maven.conf-openjdk8
%files openjdk11
%config %{_javaconfdir}/maven.conf-openjdk11
%files openjdk17
%config %{_javaconfdir}/maven.conf-openjdk17
%files javadoc -f .mfiles-javadoc
%license LICENSE NOTICE
%files openjdk21
%config %{_javaconfdir}/maven.conf-openjdk21
%changelog
* Sat Nov 23 2024 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-19
- Switch to Fedora tests
* Thu Nov 21 2024 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-18
- Fix patch usage
* Wed Nov 20 2024 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-17
- Rebuild with regenerated Requires on Java
* Thu Oct 17 2024 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-16
- Suggest maven-openjdk17
- Resolves: RHEL-62398
* Thu Oct 17 2024 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-16
- Add maven-openjdk21
- Resolves: RHEL-62407
* Tue Jan 31 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-15
- Add missing Requires on which
- Resolves: rhbz#2165596
* Mon Jan 30 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-15
- Turn hard dependency on java-devel into a weak dependencny
- Resolves: rhbz#2165593
* Thu Dec 01 2022 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-15
- Do not override JAVA_HOME set by user
- Resolves: rhbz#2096431
* Fri Sep 24 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-14
- Add OpenJDK 17 binding
* Thu Aug 19 2021 Marian Koncek <mkoncek@redhat.com> - 1:3.6.3-13
- Create a symlink to jansi shared object
- Related: rhbz#1994935
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.6.3-12
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Jun 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-11
- Rebuild to workaround DistroBaker issue
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-10
- Bootstrap Maven for CentOS Stream 9
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-9
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.6.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Dec 24 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-2
- Move launcher scripts from maven-lib to maven package
* Mon Dec 14 2020 Jerry James <loganjerry@gmail.com> - 1:3.6.3-7
- Update jansi dep to jansi1
* Wed Sep 30 2020 Christopher Tubbs <ctubbsii@fedoraproject.org> - 1:3.6.3-6
- Remove unneeded commons-logging from runtime class path (rhbz#1883751)
- Also remove redundant commons-codec
* Tue Aug 25 2020 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.3-5
- Adapt to cdi-api switch from jboss-interceptor to jakarta-interceptor.
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.6.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 1:3.6.3-3
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Thu Jun 25 2020 Alexander Kurtakov <akurtako@redhat.com> 1:3.6.3-2
- Switch jsr250 to jakarta-anntations.
* Mon May 25 2020 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.3-1
- Update to version 3.6.3.
* Thu May 14 2020 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.2-1
- Update to version 3.6.2.
* Thu May 14 2020 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.1-6
- Port to modello 1.11.
* Thu Feb 27 2020 Marian Koncek <mkoncek@redhat.com> - 1:3.6.3-1
- Update to upstream version 3.6.3
* Wed Feb 05 2020 Dinesh Prasanth M K <dmoluguw@redhat.com> - 1:3.6.1-5
- Require the updated version of slf4j.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jan 25 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.2-4
- Build with OpenJDK 8
* Thu Jan 23 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.2-3
- Implement JDK bindings
* Thu Nov 21 2019 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.1-3
- Require the correct version of guava.
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.2-2
- Mass rebuild for javapackages-tools 201902
* Mon Nov 04 2019 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.1-2
- Fix postun scriptlet.
* Wed Oct 16 2019 Fabio Valentini <decathorpe@gmail.com> - 1:3.6.1-1
- Update to version 3.6.1.
* Thu Oct 03 2019 Marian Koncek <mkoncek@redhat.com> - 1:3.6.2-1
- Update to upstream version 3.6.2
* Thu Aug 29 2019 Fabio Valentini <decathorpe@gmail.com> - 1:3.5.4-12
- Remove dependency on logback-classic.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.5.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jul 03 2019 Marian Koncek <mkoncek@redhat.com> - 1:3.6.1-5
- Port to modello version 1.11
* Thu May 30 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.1-4
- Backport upstream fix for Tycho P2 integarion
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.1-3
- Mass rebuild for javapackages-tools 201901
* Wed Apr 17 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.5.4-10
- Update to Mockito 2
* Wed Apr 17 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.1-2
- Update to Mockito 2
* Sat Apr 13 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.1-1
- Update to upstream version 3.6.1
* Fri Apr 12 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.5.4-6
- Update SLF4J version to 1.7.26
* Wed Mar 20 2019 Peter Robinson <pbrobinson@fedoraproject.org> 1:3.5.4-9
- Fix dependency on alternatives
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.5.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Oct 22 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.5.4-7
- Revert unwanted dependency change
* Mon Oct 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1:3.5.4-6
- Specify alternatives as dep, not chkconfig
* Mon Jul 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1:3.5.4-2
- Require javapackages-tools for maven-lib.

Loading…
Cancel
Save