mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
Revive support for URLClassLoader in ClassicPluginStrategy (#5698)
This commit is contained in:
1 parent
16022de422
commit
a8c4d753d4
5 files changed
+107
-18
No files matched your search
@@ -37,6 +37,7 @@ import jenkins.ExtensionFilter;
|
||||
import jenkins.plugins.DetachedPluginsUtil;
|
||||
import jenkins.util.AntClassLoader;
|
||||
import jenkins.util.SystemProperties;
|
||||
import jenkins.util.URLClassLoader2;
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.apache.tools.ant.Project;
|
||||
@@ -296,9 +297,17 @@ public class ClassicPluginStrategy implements PluginStrategy {
|
||||
}
|
||||
}
|
||||
|
||||
AntClassLoader classLoader = new AntClassLoader(parent, true);
|
||||
classLoader.addPathFiles(paths);
|
||||
return classLoader;
|
||||
if (useAntClassLoader) {
|
||||
AntClassLoader classLoader = new AntClassLoader(parent, true);
|
||||
classLoader.addPathFiles(paths);
|
||||
return classLoader;
|
||||
} else {
|
||||
List<URL> urls = new ArrayList<>();
|
||||
for (File path : paths) {
|
||||
urls.add(path.toURI().toURL());
|
||||
}
|
||||
return new URLClassLoader2(urls.toArray(new URL[0]), parent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -704,7 +713,5 @@ public class ClassicPluginStrategy implements PluginStrategy {
|
||||
}
|
||||
}
|
||||
|
||||
/* Unused since 1.527, see https://github.com/jenkinsci/jenkins/commit/47de54d070f67af95b4fefb6d006a72bb31a5cb8 */
|
||||
@Deprecated
|
||||
public static boolean useAntClassLoader = SystemProperties.getBoolean(ClassicPluginStrategy.class.getName()+".useAntClassLoader");
|
||||
public static /* not final */ boolean useAntClassLoader = SystemProperties.getBoolean(ClassicPluginStrategy.class.getName() + ".useAntClassLoader", true);
|
||||
}
|
||||
Reference in new issue
Block a user