Status: Closed (View Workflow)
It appears since the last two releases, my utility class no longer resolves if I they are in my classpath, which I stipulate vis class path on the jobDsl step.
The utility class is just a groovy file with one class:
I use to be able to import it in my seed jobs, but it no longer works:
ERROR: startup failed: /var/jenkins_home/workspace/seed/meta_jobs/seed/seed.groovy: 3: unable to resolve class robo.RoboUtil @ line 3, column 1. import robo.RoboUtil ^
I am pretty sure this is due to this change:
Use Groovy Shell instead of Groovy Script Engine to run DSL scripts, see Migration (#976)
But I am not sure... I don't fully understand what it means to use the shell over the engine.
I'm running into this issue and I can't find a way to resolve this. There is no classpath option in the Process Job DSLs build step anymore in the latest plugin. No value of CLASSPATH in preparing an environment seems to get this working. I have version 1.60 of the Job DSL plugin and version 2.46.1 of Jenkins. Please advise. Thanks.
spackard the behavior has changed in 1.60 to address a security vulnerability. See https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-160
Is this your seed job config? https://github.com/hypergig/robo-jenkins/blob/master/robo-jenkins/usr/share/jenkins/seed.xml
You can't use meta_jobs/libs/** to add Groovy files to the classpath. That was just happening by accident I guess. You need to add the directory of the root package instead, e.g. meta_jobs/libs. If you use any JARs, you need a second entry for those, e.g. meta_jobs/libs/*.jar.