mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Upgrade to Maven Resolver 1.9.14
Closes gh-36731
This commit is contained in:
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") {
|
group("org.apache.maven.resolver") {
|
||||||
modules = [
|
modules = [
|
||||||
"maven-resolver-api",
|
"maven-resolver-api",
|
||||||
|
@ -42,7 +42,6 @@ import org.eclipse.aether.artifact.DefaultArtifact;
|
|||||||
import org.eclipse.aether.collection.CollectRequest;
|
import org.eclipse.aether.collection.CollectRequest;
|
||||||
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
|
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
|
||||||
import org.eclipse.aether.graph.Dependency;
|
import org.eclipse.aether.graph.Dependency;
|
||||||
import org.eclipse.aether.impl.DefaultServiceLocator;
|
|
||||||
import org.eclipse.aether.repository.LocalRepository;
|
import org.eclipse.aether.repository.LocalRepository;
|
||||||
import org.eclipse.aether.repository.RemoteRepository;
|
import org.eclipse.aether.repository.RemoteRepository;
|
||||||
import org.eclipse.aether.resolution.ArtifactResult;
|
import org.eclipse.aether.resolution.ArtifactResult;
|
||||||
@ -230,11 +229,9 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
|
|||||||
|
|
||||||
private static List<URL> resolveCoordinates(String[] coordinates) {
|
private static List<URL> resolveCoordinates(String[] coordinates) {
|
||||||
Exception latestFailure = null;
|
Exception latestFailure = null;
|
||||||
DefaultServiceLocator serviceLocator = MavenRepositorySystemUtils.newServiceLocator();
|
RepositorySystem repositorySystem = createRepositorySystem();
|
||||||
serviceLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
|
|
||||||
serviceLocator.addService(TransporterFactory.class, HttpTransporterFactory.class);
|
|
||||||
RepositorySystem repositorySystem = serviceLocator.getService(RepositorySystem.class);
|
|
||||||
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
|
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
|
||||||
|
session.setSystemProperties(System.getProperties());
|
||||||
LocalRepository localRepository = new LocalRepository(System.getProperty("user.home") + "/.m2/repository");
|
LocalRepository localRepository = new LocalRepository(System.getProperty("user.home") + "/.m2/repository");
|
||||||
RemoteRepository remoteRepository = new RemoteRepository.Builder("central", "default",
|
RemoteRepository remoteRepository = new RemoteRepository.Builder("central", "default",
|
||||||
"https://repo.maven.apache.org/maven2")
|
"https://repo.maven.apache.org/maven2")
|
||||||
@ -260,6 +257,15 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
|
|||||||
latestFailure);
|
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) {
|
private static List<Dependency> createDependencies(String[] allCoordinates) {
|
||||||
List<Dependency> dependencies = new ArrayList<>();
|
List<Dependency> dependencies = new ArrayList<>();
|
||||||
for (String coordinate : allCoordinates) {
|
for (String coordinate : allCoordinates) {
|
||||||
|
Loading…
Reference in New Issue
Block a user