This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch maven-3.8.x-resolver-1.8.x in repository https://gitbox.apache.org/repos/asf/maven.git
commit aa1e969d59c45edaea6fc86c6b096785f424c934 Author: Michael Osipov <micha...@apache.org> AuthorDate: Sun Apr 25 22:51:01 2021 +0200 [MNG-7151] Upgrade Maven Resolver to 1.7.0 --- ...=> unrecognized-javax.annotation-api-1.3.2.txt} | 0 .../internal/DefaultVersionRangeResolver.java | 2 +- .../internal/DefaultVersionResolver.java | 2 +- .../repository/internal/MavenAetherModule.java | 80 ---------------------- .../internal/MavenRepositorySystemUtils.java | 2 + pom.xml | 6 +- 6 files changed, 7 insertions(+), 85 deletions(-) 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 83c82a038..d870fbb95 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 d307c55a6..9f1680726 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 41e98aaea..000000000 --- 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<MetadataGeneratorFactory> provideMetadataGeneratorFactories( @Named( "snapshot" ) - MetadataGeneratorFactory snapshot, - @Named( "versions" ) - MetadataGeneratorFactory versions ) - { - Set<MetadataGeneratorFactory> 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 97035b3cc..b073e2d1e 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 15893c7d1..bdba1aba4 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ under the License. <cipherVersion>2.0</cipherVersion> <modelloVersion>1.11</modelloVersion> <jxpathVersion>1.3</jxpathVersion> - <resolverVersion>1.6.3</resolverVersion> + <resolverVersion>1.7.0</resolverVersion> <slf4jVersion>1.7.36</slf4jVersion> <xmlunitVersion>2.2.1</xmlunitVersion> <powermockVersion>1.7.4</powermockVersion> @@ -268,7 +268,7 @@ under the License. <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> - <version>1.2</version> + <version>1.3.2</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -545,7 +545,7 @@ under the License. ! Excluded the license files itself cause they do not have have a license of themselves. --> <exclude>src/main/appended-resources/licenses/EPL-1.0.txt</exclude> - <exclude>src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.2.txt</exclude> + <exclude>src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt</exclude> </excludes> </configuration> </plugin>