Merge branch '2.7.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,6 +26,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
import groovy.grape.GrapeEngine;
|
||||
import groovy.lang.GroovyClassLoader;
|
||||
import groovy.lang.GroovyClassLoader.ClassCollector;
|
||||
import groovy.lang.GroovyCodeSource;
|
||||
@@ -44,10 +45,9 @@ import org.codehaus.groovy.transform.ASTTransformation;
|
||||
import org.codehaus.groovy.transform.ASTTransformationVisitor;
|
||||
|
||||
import org.springframework.boot.cli.compiler.dependencies.SpringBootDependenciesDependencyManagement;
|
||||
import org.springframework.boot.cli.compiler.grape.AetherGrapeEngine;
|
||||
import org.springframework.boot.cli.compiler.grape.AetherGrapeEngineFactory;
|
||||
import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext;
|
||||
import org.springframework.boot.cli.compiler.grape.GrapeEngineInstaller;
|
||||
import org.springframework.boot.cli.compiler.grape.MavenResolverGrapeEngineFactory;
|
||||
import org.springframework.boot.cli.util.ResourceUtils;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
import org.springframework.util.ClassUtils;
|
||||
@@ -96,7 +96,7 @@ public class GroovyCompiler {
|
||||
DependencyResolutionContext resolutionContext = new DependencyResolutionContext();
|
||||
resolutionContext.addDependencyManagement(new SpringBootDependenciesDependencyManagement());
|
||||
|
||||
AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
|
||||
GrapeEngine grapeEngine = MavenResolverGrapeEngineFactory.create(this.loader,
|
||||
configuration.getRepositoryConfiguration(), resolutionContext, configuration.isQuiet());
|
||||
|
||||
GrapeEngineInstaller.install(grapeEngine);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,15 +44,15 @@ import org.eclipse.aether.util.filter.DependencyFilterUtils;
|
||||
|
||||
/**
|
||||
* A {@link GrapeEngine} implementation that uses
|
||||
* <a href="https://eclipse.org/aether">Aether</a>, the dependency resolution system used
|
||||
* by Maven.
|
||||
* <a href="https://maven.apache.org/resolver/index.html">Maven Resolver</a>, the
|
||||
* dependency resolution system used by Maven.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
* @since 1.0.0
|
||||
* @since 2.5.9
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class AetherGrapeEngine implements GrapeEngine {
|
||||
public class MavenResolverGrapeEngine implements GrapeEngine {
|
||||
|
||||
private static final Collection<Exclusion> WILDCARD_EXCLUSION;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class AetherGrapeEngine implements GrapeEngine {
|
||||
|
||||
private final List<RemoteRepository> repositories;
|
||||
|
||||
public AetherGrapeEngine(GroovyClassLoader classLoader, RepositorySystem repositorySystem,
|
||||
public MavenResolverGrapeEngine(GroovyClassLoader classLoader, RepositorySystem repositorySystem,
|
||||
DefaultRepositorySystemSession repositorySystemSession, List<RemoteRepository> remoteRepositories,
|
||||
DependencyResolutionContext resolutionContext, boolean quiet) {
|
||||
this.classLoader = classLoader;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,14 +36,14 @@ import org.eclipse.aether.transport.file.FileTransporterFactory;
|
||||
import org.eclipse.aether.transport.http.HttpTransporterFactory;
|
||||
|
||||
/**
|
||||
* Utility class to create a pre-configured {@link AetherGrapeEngine}.
|
||||
* Utility class to create a pre-configured {@link MavenResolverGrapeEngine}.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.0.0
|
||||
* @since 2.5.9
|
||||
*/
|
||||
public abstract class AetherGrapeEngineFactory {
|
||||
public abstract class MavenResolverGrapeEngineFactory {
|
||||
|
||||
public static AetherGrapeEngine create(GroovyClassLoader classLoader,
|
||||
public static MavenResolverGrapeEngine create(GroovyClassLoader classLoader,
|
||||
List<RepositoryConfiguration> repositoryConfigurations,
|
||||
DependencyResolutionContext dependencyResolutionContext, boolean quiet) {
|
||||
RepositorySystem repositorySystem = createServiceLocator().getService(RepositorySystem.class);
|
||||
@@ -54,7 +54,7 @@ public abstract class AetherGrapeEngineFactory {
|
||||
autoConfiguration.apply(repositorySystemSession, repositorySystem);
|
||||
}
|
||||
new DefaultRepositorySystemSessionAutoConfiguration().apply(repositorySystemSession, repositorySystem);
|
||||
return new AetherGrapeEngine(classLoader, repositorySystem, repositorySystemSession,
|
||||
return new MavenResolverGrapeEngine(classLoader, repositorySystem, repositorySystemSession,
|
||||
createRepositories(repositoryConfigurations), dependencyResolutionContext, quiet);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,8 +20,8 @@ import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
|
||||
/**
|
||||
* Strategy that can be used to apply some auto-configuration during the installation of
|
||||
* an {@link AetherGrapeEngine}.
|
||||
* Strategy that can be used to apply some auto-configuration during the installation of a
|
||||
* {@link MavenResolverGrapeEngine}.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.0.0
|
||||
|
||||
Reference in New Issue
Block a user