如何关闭Jenkins Groovy沙箱?

时间:2016-11-09 12:44:18

标签: jenkins groovy

我想在Groovy中使用FTP(Jenkinsfile)。但是我得到了这个错误日志。我认为是Groovy沙箱,我可以关闭吗?

这是我在文件顶部的配置。

@Grapes([
        @Grab(group='commons-net', module='commons-net', version='3.3'),
        @GrabConfig(systemClassLoader=true)
    ])

这是我的日志:

java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:432)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:411)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:374)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:220)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:401)
Caused by: java.lang.RuntimeException: No suitable ClassLoader found for grab

0 个答案:

没有答案