| I updated the Pipeline-groovy (from 2.62 to 2.74) and the PermissiveScriptSecurity plugin (0.4 to0.5). The Pipeline-groovy upgrade pulled in some new versions of dependencies. Now variable expansion in strings in pipelines cause exception: This fails:
ode {
stage('Testing') {
foo = 'bar'
echo "${foo}"
}
}
java.lang.NoSuchMethodError: org.kohsuke.groovy.sandbox.impl.Checker.preCheckedCast(Ljava/lang/Class;Ljava/lang/Object;ZZZ)Lorg/kohsuke/groovy/sandbox/impl/Checker$Thunk;
at org.jenkinsci.plugins.workflow.cps.CpsWhitelist.permitsStaticMethod(CpsWhitelist.java:102)
at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist.permitsStaticMethod(ProxyWhitelist.java:188)
at org.jenkinsci.plugins.workflow.cps.GroovyClassLoaderWhitelist.permitsStaticMethod(GroovyClassLoaderWhitelist.java:52)
...
Finished: FAILURE
This passes:
node {
stage('Testing') {
foo = 'bar'
echo foo
}
}
[Pipeline] echo bar [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS
A (painful) workaround is to replace all variable expansion code with string concatenation. |