Update to upstream version 3.9.1

This commit is contained in:
Mikolaj Izdebski 2023-03-21 09:40:58 +01:00
parent 3c1abed25c
commit 9baf7da6aa
10 changed files with 136 additions and 259 deletions

1
.gitignore vendored
View File

@ -30,3 +30,4 @@
/apache-maven-3.8.4-src.tar.gz
/apache-maven-3.8.5-src.tar.gz
/apache-maven-3.8.6-src.tar.gz
/apache-maven-3.9.1-src.tar.gz

View File

@ -1,14 +1,14 @@
From 3c59030162ccb3c38cf62a74a36e52cead52706b Mon Sep 17 00:00:00 2001
From abda3bfec41730810ee98e685b128f27ddc24c36 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/6] Adapt mvn script
Subject: [PATCH 1/3] Adapt mvn script
---
apache-maven/src/bin/mvn | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
apache-maven/src/bin/mvn | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index dfa384b8e..605c0edd3 100755
index a3004f917..9b118717e 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -22,7 +22,7 @@
@ -17,10 +17,18 @@ index dfa384b8e..605c0edd3 100755
#
-# JAVA_HOME Must point at your Java Development Kit installation.
+# JAVA_HOME (Optional) Must point at your Java Development Kit installation.
# MAVEN_ARGS (Optional) Arguments passed to Maven before CLI arguments.
# MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
# MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
# -----------------------------------------------------------------------------
@@ -37,12 +37,18 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
@@ -30,20 +30,22 @@
if [ -z "$MAVEN_SKIP_RC" ] ; then
- if [ -f /usr/local/etc/mavenrc ] ; then
- . /usr/local/etc/mavenrc
- fi
-
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
@ -39,7 +47,7 @@ index dfa384b8e..605c0edd3 100755
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
mingw=false;
@@ -67,7 +73,8 @@ done
@@ -68,7 +70,8 @@ done
saveddir=`pwd`
@ -50,5 +58,5 @@ index dfa384b8e..605c0edd3 100755
# make it fully qualified
MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
--
2.35.1
2.39.2

View File

@ -1,24 +1,23 @@
From 4d0c432cf88f2f70e6f793569d3dedace062fdef Mon Sep 17 00:00:00 2001
From a59ddba0d41b0ba1ea9c8c6ac541a71d737cdf30 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/6] Invoke logback via reflection
Subject: [PATCH 2/3] Invoke logback via reflection
---
.../logging/impl/LogbackConfiguration.java | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
.../cli/logging/impl/LogbackConfiguration.java | 18 +++++++++++++-----
1 file changed, 13 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 4dc5a37b8..a977ba085 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 @@
@@ -31,21 +31,29 @@
public class LogbackConfiguration extends BaseSlf4jConfiguration {
@Override
public void setRootLoggerLevel( Level level )
{
public void setRootLoggerLevel(Level level) {
- ch.qos.logback.classic.Level value;
+ String value;
switch ( level )
{
switch (level) {
case DEBUG:
- value = ch.qos.logback.classic.Level.DEBUG;
+ value = "DEBUG";
@ -34,14 +33,13 @@ index 5d9fab744..ced38cb5a 100644
+ value = "ERROR";
break;
}
- ( (ch.qos.logback.classic.Logger) LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME ) ).setLevel( value );
+ Logger logger = LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME );
- ((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});
+ loggerClass.getMethod("setLevel", new Class<?>[] {levelClass}).invoke(logger, new Object[] {logbackLevel});
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to initialize logback configuration", e);
+ }
@ -49,5 +47,5 @@ index 5d9fab744..ced38cb5a 100644
@Override
--
2.35.1
2.39.2

View File

@ -0,0 +1,89 @@
From ad1e669b96a5d251c36384e89d535b9c712a6246 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 5 Sep 2019 15:21:04 +0200
Subject: [PATCH 3/3] Remove dependency on powermock
---
.../StringSearchModelInterpolatorTest.java | 59 -------------------
1 file changed, 59 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 b2612e540..20b7162e2 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
@@ -35,8 +35,6 @@
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
@@ -344,63 +342,6 @@ public void testInterpolateObjectWithPomFile() throws Exception {
is(System.getProperty("user.dir") + File.separator + '.' + File.separator + "target"))));
}
- 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 {
final Model model = new Model();
--
2.39.2

View File

@ -1,51 +0,0 @@
From 81328d875bca5aae7d26e2058f4568a610c680d4 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 1 Jul 2019 09:51:56 +0200
Subject: [PATCH 3/6] 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 7ff412767..b15091576 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>
<groupId>org.slf4j</groupId>
diff --git a/pom.xml b/pom.xml
index c319cae26..42afab5f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -333,7 +333,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.35.1

View File

@ -1,96 +0,0 @@
From d0bc26194a0e432206d7f92cf0b6fbef67946cc4 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 5 Sep 2019 15:21:04 +0200
Subject: [PATCH 4/6] 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 c95e37271..aafafa52f 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 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
@@ -375,70 +373,6 @@ public void testInterpolateObjectWithPomFile()
) ) );
}
- 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.35.1

View File

@ -1,25 +0,0 @@
From 25be70bc5a6eb0ddc2838a631cf1a5e20c784e1e Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 17 Dec 2021 13:05:49 +0100
Subject: [PATCH 5/6] Port to maven-resolver 1.7.2
---
.../org/apache/maven/repository/internal/MavenAetherModule.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java
index 41e98aaea..d72e3c0f3 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java
@@ -28,7 +28,7 @@
import org.apache.maven.model.building.DefaultModelBuilderFactory;
import org.apache.maven.model.building.ModelBuilder;
-import org.eclipse.aether.impl.AetherModule;
+import org.eclipse.aether.impl.guice.AetherModule;
import org.eclipse.aether.impl.ArtifactDescriptorReader;
import org.eclipse.aether.impl.MetadataGeneratorFactory;
import org.eclipse.aether.impl.VersionRangeResolver;
--
2.35.1

View File

@ -1,37 +0,0 @@
From 7f97d98125938d065c2025716f041a1dbde326c2 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Fri, 22 Apr 2022 11:15:38 +0200
Subject: [PATCH 6/6] Restore DefaultModelValidator compatibility with Maven
3.5.4
---
.../maven/model/validation/DefaultModelValidator.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index f77321c16..4ed22f3ed 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -44,6 +44,7 @@
import org.apache.maven.model.building.ModelProblem.Version;
import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.building.ModelProblemCollectorRequest;
+import org.apache.maven.model.interpolation.DefaultModelVersionProcessor;
import org.apache.maven.model.interpolation.ModelVersionProcessor;
import org.codehaus.plexus.util.StringUtils;
@@ -85,6 +86,11 @@
private ModelVersionProcessor versionProcessor;
+ public DefaultModelValidator()
+ {
+ this( new DefaultModelVersionProcessor() );
+ }
+
@Inject
public DefaultModelValidator( ModelVersionProcessor versionProcessor )
{
--
2.35.1

View File

@ -6,8 +6,8 @@
Name: maven
Epoch: 1
Version: 3.8.6
Release: 4%{?dist}
Version: 3.9.1
Release: 1%{?dist}
Summary: Java project management and project comprehension tool
# maven itself is ASL 2.0
# bundled slf4j is MIT
@ -21,22 +21,19 @@ Source1: maven-bash-completion
Source2: mvn.1
Patch1: 0001-Adapt-mvn-script.patch
# Downstream-specific, avoids dependency on logback
# Used only when %%without logback is in effect
# Downstream-specific, avoids build-dependency on logback
Patch2: 0002-Invoke-logback-via-reflection.patch
Patch3: 0003-Use-non-shaded-HTTP-wagon.patch
Patch4: 0004-Remove-dependency-on-powermock.patch
Patch5: 0005-Port-to-maven-resolver-1.7.2.patch
# XMvn needs to be ported to Maven 3.8.5
# For now restore backwards compatibility with Maven 3.8.4
Patch6: 0006-Restore-DefaultModelValidator-compatibility-with-Mav.patch
Patch3: 0003-Remove-dependency-on-powermock.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap-openjdk8
%else
BuildRequires: maven-local-openjdk8
BuildRequires: mvn(com.google.inject:guice::no_aop:)
BuildRequires: mvn(com.google.guava:failureaccess)
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(com.google.inject:guice)
BuildRequires: mvn(commons-cli:commons-cli)
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(commons-jxpath:commons-jxpath)
BuildRequires: mvn(javax.annotation:javax.annotation-api)
BuildRequires: mvn(javax.inject:javax.inject)
@ -51,6 +48,8 @@ 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)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-spi)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-transport-file)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-transport-http)
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)
@ -159,9 +158,6 @@ find -name 'pom.xml' -exec sed -i 's/\r//' {} +
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
# not really used during build, but a precaution
find -name '*.jar' -not -path '*/test/*' -delete
@ -196,11 +192,8 @@ sed -i "
%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
%pom_remove_plugin :plexus-component-metadata maven-model-builder
%pom_add_plugin org.eclipse.sisu:sisu-maven-plugin maven-model-builder
%build
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
@ -225,12 +218,6 @@ cp -a $M2_HOME/{bin,lib,boot} %{buildroot}%{homedir}/
xmvn-subst -s -R %{buildroot} -s %{buildroot}%{homedir}
%endif
# Workaround for xmvn-subst being unable to create symlink for MBI-built guice
# XXX Remove once Guice is updated to version 5.
%if %{with bootstrap}
ln -sf %{_javadir}/google-guice-no_aop.jar %{buildroot}%{homedir}/lib/guice-4.*-no_aop.jar
%endif
# 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/
@ -309,6 +296,9 @@ if [[ $1 -eq 0 ]]; then update-alternatives --remove mvn %{homedir}/bin/mvn; fi
%config %{_javaconfdir}/maven.conf-openjdk17
%changelog
* Tue Mar 21 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.9.1-1
- Update to upstream version 3.9.1
* Fri Jan 27 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.8.6-4
- Turn hard dependency on java-devel into a weak dependencny

View File

@ -1 +1 @@
SHA512 (apache-maven-3.8.6-src.tar.gz) = 03366d0d34bba79ce6f22220d5e88390e360fbf2f61c273bc18885a21a6d4dcdf5eca14fe4d902735e4fcb03db32327be086e3927d259c519aa790f42142cfcb
SHA512 (apache-maven-3.9.1-src.tar.gz) = 726679381d4660150f88a727e16005cecd0fee6c03748ae8db889cfe88a2da7ac378f0d221bf237953bba3c49542d2bd7233888eb549cf7c10dd4e2deb2a3828