From 453c17371319e985d3a6caba84ae240bb33d6870 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 25 Apr 2021 22:51:01 +0200 Subject: [PATCH] [MNG-7247] Upgrade Maven Resolver to 1.7.2 --- ...recognized-javax.annotation-api-1.3.2.txt} | 0 .../internal/DefaultVersionRangeResolver.java | 2 +- .../internal/DefaultVersionResolver.java | 2 +- .../internal/MavenAetherModule.java | 80 ------------------- .../internal/MavenRepositorySystemUtils.java | 2 + pom.xml | 6 +- 6 files changed, 7 insertions(+), 85 deletions(-) rename apache-maven/src/main/appended-resources/licenses/{unrecognized-javax.annotation-api-1.2.txt => unrecognized-javax.annotation-api-1.3.2.txt} (100%) delete mode 100644 maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java diff --git a/apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt b/apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt similarity index 100% rename from apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt rename to apache-maven/src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 83c82a0385..d870fbb951 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -28,7 +28,6 @@ import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.RepositoryEventDispatcher; -import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; @@ -42,6 +41,7 @@ import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.synccontext.SyncContextFactory; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index d307c55a69..9f1680726c 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -33,7 +33,6 @@ import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.RepositoryEventDispatcher; -import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; @@ -49,6 +48,7 @@ import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.synccontext.SyncContextFactory; import org.eclipse.aether.util.ConfigUtils; import javax.inject.Inject; 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 deleted file mode 100644 index 41e98aaea8..0000000000 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenAetherModule.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.apache.maven.repository.internal; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import javax.inject.Named; -import javax.inject.Singleton; - -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.ArtifactDescriptorReader; -import org.eclipse.aether.impl.MetadataGeneratorFactory; -import org.eclipse.aether.impl.VersionRangeResolver; -import org.eclipse.aether.impl.VersionResolver; - -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.name.Names; - -/** - * @deprecated As of Maven Resolver 1.0.3, please use class {@link MavenResolverModule}. - */ -@Deprecated -public final class MavenAetherModule - extends AbstractModule -{ - - @Override - protected void configure() - { - install( new AetherModule() ); - bind( ArtifactDescriptorReader.class ) // - .to( DefaultArtifactDescriptorReader.class ).in( Singleton.class ); - bind( VersionResolver.class ) // - .to( DefaultVersionResolver.class ).in( Singleton.class ); - bind( VersionRangeResolver.class ) // - .to( DefaultVersionRangeResolver.class ).in( Singleton.class ); - bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "snapshot" ) ) // - .to( SnapshotMetadataGeneratorFactory.class ).in( Singleton.class ); - bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "versions" ) ) // - .to( VersionsMetadataGeneratorFactory.class ).in( Singleton.class ); - bind( ModelBuilder.class ) // - .toInstance( new DefaultModelBuilderFactory().newInstance() ); - } - - @Provides - @Singleton - Set provideMetadataGeneratorFactories( @Named( "snapshot" ) - MetadataGeneratorFactory snapshot, - @Named( "versions" ) - MetadataGeneratorFactory versions ) - { - Set factories = new HashSet<>(); - factories.add( snapshot ); - factories.add( versions ); - return Collections.unmodifiableSet( factories ); - } - -} diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 97035b3cc8..b073e2d1e5 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -68,7 +68,9 @@ public final class MavenRepositorySystemUtils * acquire a complete repository system, clients need to add some repository connectors for remote transfers. * * @return The new service locator, never {@code null}. + * @deprecated This method is deprecated along with {@link DefaultServiceLocator} (since Maven Resolver 1.7.0). */ + @Deprecated public static DefaultServiceLocator newServiceLocator() { DefaultServiceLocator locator = new DefaultServiceLocator(); diff --git a/pom.xml b/pom.xml index f9d305585c..f6f9b6c829 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ under the License. 2.0 1.11 1.3 - 1.6.3 + 1.7.2 1.7.32 2.2.1 1.7.4 @@ -268,7 +268,7 @@ under the License. javax.annotation javax.annotation-api - 1.2 + 1.3.2 org.codehaus.plexus @@ -545,7 +545,7 @@ under the License. ! Excluded the license files itself cause they do not have have a license of themselves. --> src/main/appended-resources/licenses/EPL-1.0.txt - src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt + src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt