Jenkins calling groovy script security errors

我只是一个虾纸丫 提交于 2019-12-11 04:33:14

问题


I'm currently working on running bentolor's idea-cli-inspector in my pipeline for static analysis. Unfortunately, I cannot find any documentation on how to allow parameters using the "load" command, and this command works by bringing in source anyway, so I made my own function, but unfortunately, it isn't quite working out (probably due to script security).

Function:

def callIdeaInspector() {
    String[] args = ['-i', '/Applications/Android\\ Studio.app/', '-p', '.idea/inspectionProfiles/CompanyName.xml', '-d',
        'src/main/java/com/CompanyName/', '-l', 'ERROR']
    Binding context = new Binding(args)
    result = new GroovyShell(context).evaluate(new File("../btMobileApp/ideainspect.groovy"))
}

Error:

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified new groovy.lang.Binding java.util.ArrayList

回答1:


Go to Manage Jenkins → In-process Script Approval and approve all requests there. Re-run the script and repeat the process if needed.



来源:https://stackoverflow.com/questions/37348453/jenkins-calling-groovy-script-security-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!