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