GH-251 Fixed JDK 11 issues
- Added JDK 11 hook in FunctionCreatorConfiguration for javax.annotation to be loaded from current CL - Ensured the file: protocol resources end with the forward slash. See UrlClassPath.getLoader of JDK 11 for more details as to why - Re-enabled conditional tests by removing Java 8 assumptions - Part of the issue was also, the invoker plugin which was only generating ‘it/..’ directory every other time due to exists condition, thus resulting in some test failures every other time (missing directory) Resolves #251
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2019 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.
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
|
||||
* reactor-core (if present). It can then share the reactor dependency with other class
|
||||
* loaders that the app itself creates, without any other classes being shared, other than
|
||||
* the core JDK.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ public class ApplicationBootstrap {
|
||||
/**
|
||||
* Run the provided main class as a Spring Boot application with the provided command
|
||||
* line arguments.
|
||||
*
|
||||
*
|
||||
* @param mainClass the main class
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
@@ -141,6 +141,7 @@ public class ApplicationBootstrap {
|
||||
return new URLClassLoader(child.toArray(new URL[0]), base);
|
||||
}
|
||||
|
||||
|
||||
private URL[] findClassPath(Class<?> mainClass) {
|
||||
ClassLoader base = mainClass.getClassLoader();
|
||||
if (!(base instanceof URLClassLoader)) {
|
||||
@@ -152,10 +153,7 @@ public class ApplicationBootstrap {
|
||||
result.add(mainClass.getProtectionDomain().getCodeSource().getLocation());
|
||||
for (URL url : list) {
|
||||
String path = url.toString();
|
||||
path = path.substring(0, path.length() - "/META-INF".length());
|
||||
if (path.endsWith("!")) {
|
||||
path = path + "/";
|
||||
}
|
||||
path = path.substring(0, path.length() - "/META-INF".length()) + "/";
|
||||
result.add(new URL(path));
|
||||
}
|
||||
return result.toArray(new URL[result.size()]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2019 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.
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.ClassUtils;
|
||||
* Initialize an instance of this class with the class loader to be used and the name of
|
||||
* the main class (usually a <code>@SpringBootApplication</code>), and then
|
||||
* {@link #run(String...)} it, cleaning up with a call to {@link #close()}.
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class ApplicationRunner {
|
||||
@@ -148,7 +148,7 @@ public class ApplicationRunner {
|
||||
|
||||
/**
|
||||
* List the bean names in the application context for a given type (by its fully qualified name).
|
||||
*
|
||||
*
|
||||
* @param type the name of the type (Class)
|
||||
* @return the bean names of that type
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2019 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2019 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.
|
||||
@@ -21,13 +21,11 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.system.JavaVersion;
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
import org.springframework.cloud.function.context.catalog.FunctionInspector;
|
||||
|
||||
@@ -46,8 +44,6 @@ public class SpringFunctionFluxConfigurationTests {
|
||||
|
||||
@Before
|
||||
public void run() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
if (bootstrap == null) {
|
||||
bootstrap = new ApplicationBootstrap();
|
||||
bootstrap.run(SpringFunctionFluxConfigurationTests.class,
|
||||
|
||||
Reference in New Issue
Block a user