CompilerConfiguration conf = new CompilerConfiguration();
conf.setSourceEncoding(prop.getProperty("script-encoding"));
List<String> cll = new ArrayList<String>();
// TODO
cll.add ( your jar path )
conf.setClasspathList(cll);
下面不管是GroovyShell 还是ClassLoader方式,都用这个conf就可以了