mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
[FIXED JENKINS-44898] Add findResource to PluginFirstClassLoader (#2916)
* [FIXED JENKINS-44898] Add findResource to PluginFirstClassLoader This fixes GroovyClassLoader.loadClass for a .groovy file in a plugin with a PluginFirstClassLoader, specifically by fixing fast-loading via the UberClassLoader. * Move common code to AntWithFindResourceClassLoader. * Adding testing of new PluginFirstClassLoader behavior.
This commit is contained in:
1 parent
a5dc255d21
commit
303a9f7df7
5 files changed
+91
-50
No files matched your search
@@ -33,7 +33,7 @@ import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.tools.ant.AntClassLoader;
|
||||
import jenkins.util.AntWithFindResourceClassLoader;
|
||||
|
||||
/**
|
||||
* classLoader which use first /WEB-INF/lib/*.jar and /WEB-INF/classes before core classLoader
|
||||
@@ -42,10 +42,14 @@ import org.apache.tools.ant.AntClassLoader;
|
||||
* @since 1.371
|
||||
*/
|
||||
public class PluginFirstClassLoader
|
||||
extends AntClassLoader
|
||||
extends AntWithFindResourceClassLoader
|
||||
implements Closeable
|
||||
{
|
||||
|
||||
|
||||
public PluginFirstClassLoader() {
|
||||
super(null, false);
|
||||
}
|
||||
|
||||
private List<URL> urls = new ArrayList<URL>();
|
||||
|
||||
public void addPathFiles( Collection<File> paths )
|
||||
@@ -100,6 +104,5 @@ public class PluginFirstClassLoader
|
||||
{
|
||||
InputStream is = super.getResourceAsStream( name );
|
||||
return is;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user