Remove AntClassLoader (#7846)

This commit is contained in:
Basil Crow authored and GitHub committed 2023-04-25 09:39:41 +02:00
1 parent cb2c48bb57
commit 9ce1ff4e7c
7 files changed
+11 -274

No files matched your search

+1 -7
View File
@@ -72,7 +72,6 @@ import jenkins.YesNoMaybe;
import jenkins.model.Jenkins;
import jenkins.plugins.DetachedPluginsUtil;
import jenkins.security.UpdateSiteWarningsMonitor;
import jenkins.util.AntClassLoader;
import jenkins.util.URLClassLoader2;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.LogFactory;
@@ -414,12 +413,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
*/
@Restricted(Beta.class)
public void injectJarsToClasspath(File... jars) throws Exception {
if (classLoader instanceof AntClassLoader) {
for (File f : jars) {
LOGGER.log(Level.CONFIG, () -> "Inserting " + f + " into " + shortName + " plugin's classpath");
((AntClassLoader) classLoader).addPathComponent(f);
}
} else if (classLoader instanceof URLClassLoader2) {
if (classLoader instanceof URLClassLoader2) {
for (File f : jars) {
LOGGER.log(Level.CONFIG, () -> "Inserting " + f + " into " + shortName + " plugin's classpath");
((URLClassLoader2) classLoader).addURL(f.toURI().toURL());