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:
      https://github.com/hypergig/robo-jenkins/blob/master/robo-jenkins/usr/share/jenkins/userContent/meta_jobs/libs/robo/RoboUtil.groovy

      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)

      https://github.com/jenkinsci/job-dsl-plugin/wiki#release-notes

      But I am not sure... I don't fully understand what it means to use the shell over the engine.

          [JENKINS-40961] Groovy code in classpath no longer respected

          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.

          Daniel Spilker added a comment - 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 .

          jordan cohen added a comment -

          daspilker that was it! Thank you!

          jordan cohen added a comment - daspilker that was it! Thank you!

          jordan cohen added a comment -

          jordan cohen added a comment - https://github.com/hypergig/robo-jenkins/commit/28c5a61ca19e349a0cd0d3730787541bc80d5129 Thanks again

          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.

          Steven Packard added a comment - 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

          Daniel Spilker added a comment - 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

            daspilker Daniel Spilker
            hypergig jordan cohen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: