Carefully calculate system class loader for launcher
If you get it wrong then there is a conflict between the JarFile implementations in the deployer app and Spring Boot latest. Fixes #132
This commit is contained in:
@@ -188,11 +188,21 @@ public class LauncherCommand extends OptionParsingCommand {
|
||||
dependency.put("transitive", false);
|
||||
URI[] uris = grapeEngine.resolve(null, dependency);
|
||||
URLClassLoader loader = new URLClassLoader(new URL[] { uris[0].toURL() },
|
||||
getClass().getClassLoader().getParent().getParent());
|
||||
systemClassLoader(getClass().getClassLoader()));
|
||||
log.debug("resolved URIs " + Arrays.asList(loader.getURLs()));
|
||||
return loader;
|
||||
}
|
||||
|
||||
private ClassLoader systemClassLoader(ClassLoader classLoader) {
|
||||
if (classLoader.getParent().getParent()!=null) {
|
||||
if (classLoader.getParent().getParent().getParent()!=null) {
|
||||
return classLoader.getParent().getParent().getParent();
|
||||
}
|
||||
return classLoader.getParent().getParent();
|
||||
}
|
||||
return classLoader.getParent();
|
||||
}
|
||||
|
||||
private String getVersion() {
|
||||
Package pkg = LauncherCommand.class.getPackage();
|
||||
String version = (pkg != null ? pkg.getImplementationVersion()
|
||||
|
||||
Reference in New Issue
Block a user