Upgrade to Maven Resolver 1.9.14

Closes gh-36731
pull/36766/head
Andy Wilkinson 1 year ago
parent d76e8ad7d1
commit ce14c70fbd

@ -118,7 +118,7 @@ bom {
]
}
}
library("Maven Resolver", "1.6.3") {
library("Maven Resolver", "1.9.14") {
group("org.apache.maven.resolver") {
modules = [
"maven-resolver-api",

@ -42,7 +42,6 @@ import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactResult;
@ -230,11 +229,9 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
private static List<URL> resolveCoordinates(String[] coordinates) {
Exception latestFailure = null;
DefaultServiceLocator serviceLocator = MavenRepositorySystemUtils.newServiceLocator();
serviceLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
serviceLocator.addService(TransporterFactory.class, HttpTransporterFactory.class);
RepositorySystem repositorySystem = serviceLocator.getService(RepositorySystem.class);
RepositorySystem repositorySystem = createRepositorySystem();
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
session.setSystemProperties(System.getProperties());
LocalRepository localRepository = new LocalRepository(System.getProperty("user.home") + "/.m2/repository");
RemoteRepository remoteRepository = new RemoteRepository.Builder("central", "default",
"https://repo.maven.apache.org/maven2")
@ -260,6 +257,15 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
latestFailure);
}
@SuppressWarnings("deprecation")
private static RepositorySystem createRepositorySystem() {
org.eclipse.aether.impl.DefaultServiceLocator serviceLocator = MavenRepositorySystemUtils.newServiceLocator();
serviceLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
serviceLocator.addService(TransporterFactory.class, HttpTransporterFactory.class);
RepositorySystem repositorySystem = serviceLocator.getService(RepositorySystem.class);
return repositorySystem;
}
private static List<Dependency> createDependencies(String[] allCoordinates) {
List<Dependency> dependencies = new ArrayList<>();
for (String coordinate : allCoordinates) {

Loading…
Cancel
Save