Update reactor versions
This commit is contained in:
@@ -17,10 +17,14 @@
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-deployer-thin.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-deployer-thin.version>
|
||||
<reactor.version>3.0.4.RELEASE</reactor.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-aether-provider</artifactId>
|
||||
<version>3.3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-core</artifactId>
|
||||
|
||||
@@ -32,16 +32,12 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
|
||||
import org.springframework.boot.Banner.Mode;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory;
|
||||
import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext;
|
||||
import org.springframework.boot.loader.archive.Archive;
|
||||
import org.springframework.boot.loader.thin.AetherEngine;
|
||||
import org.springframework.boot.loader.thin.ArchiveUtils;
|
||||
import org.springframework.boot.loader.thin.DependencyResolver;
|
||||
import org.springframework.cloud.deployer.thin.ContextRunner;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
@@ -129,31 +125,23 @@ public class ApplicationRunner implements CommandLineRunner {
|
||||
for (URL url : urls) {
|
||||
child.add(url);
|
||||
}
|
||||
DependencyResolutionContext context = new DependencyResolutionContext();
|
||||
AetherEngine engine = AetherEngine.create(
|
||||
RepositoryConfigurationFactory.createDefaultRepositoryConfiguration(),
|
||||
context);
|
||||
DependencyResolver resolver = DependencyResolver.instance();
|
||||
String reactor = getReactorCoordinates();
|
||||
// spring-core is OK, spring-context is not, spring-messaging depends on
|
||||
// spring-context (so it is not OK)
|
||||
String spring = getSpringCoordinates();
|
||||
try {
|
||||
List<File> resolved = engine.resolve(
|
||||
Arrays.asList(new Dependency(new DefaultArtifact(reactor), "runtime"),
|
||||
new Dependency(new DefaultArtifact(spring), "runtime")));
|
||||
for (File archive : resolved) {
|
||||
try {
|
||||
URL url = archive.toURI().toURL();
|
||||
parent.add(url);
|
||||
child.remove(url);
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
throw new IllegalStateException("Cannot locate jar for: " + archive);
|
||||
}
|
||||
List<File> resolved = Arrays.asList(
|
||||
resolver.resolve(new Dependency(new DefaultArtifact(reactor), "runtime")),
|
||||
resolver.resolve(new Dependency(new DefaultArtifact(spring), "runtime")));
|
||||
for (File archive : resolved) {
|
||||
try {
|
||||
URL url = archive.toURI().toURL();
|
||||
parent.add(url);
|
||||
child.remove(url);
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
throw new IllegalStateException("Cannot locate jar for: " + archive);
|
||||
}
|
||||
}
|
||||
catch (ArtifactResolutionException e) {
|
||||
throw new IllegalStateException("Cannot resolve archive for " + reactor, e);
|
||||
}
|
||||
logger.info("Parent: " + parent);
|
||||
logger.info("Child: " + child);
|
||||
|
||||
Reference in New Issue
Block a user