96c96,120 < private static class ScriptCacheEntry { --- > private ClassLoader scriptParentClassLoader = getClass().getClassLoader(); > > /** > * Get the ClassLoader that will serve as the parent ClassLoader of the {@link GroovyClassLoader} in > * which scripts will be executed. By default, this is the ClassLoader that loaded the > * GroovyScriptEngine class. > * > * @return ClassLoader for scripts executed by the engine > */ > public ClassLoader getScriptParentClassLoader() { > return scriptParentClassLoader; > } > > /** > * @param cl ClassLoader to be used as the parent ClassLoader for scripts executed by the engine > */ > public void setScriptParentClassLoader(ClassLoader cl) { > if (cl == null) { > throw new IllegalArgumentException("no parameter can be null"); > } > > this.scriptParentClassLoader = cl; > } > > private static class ScriptCacheEntry { 177a202,205 > // XXX: please note this interface is very confusing. It is not clear whether the run() method takes just > // file name of the script or whether it takes the full path to the script. I think it takes the file name > // which is also confusing. Most of the time when a developer embeds groovy in his program he's going to know > // and expect to provide full path to the script--at least I know I do. -- aobele 179c207 < ScriptCacheEntry entry; --- > ScriptCacheEntry entry; 223c251 < return new GroovyClassLoader(getClass().getClassLoader()) { --- > return new GroovyClassLoader(getScriptParentClassLoader()) {