Can not make additionalClasspath work.

34 views
Skip to first unread message

Lars Berntzon

unread,
May 2, 2023, 10:27:17 AM5/2/23
to job-dsl-plugin
Im using version 1.83 of the plugin and jenkins 2.387.2. This jobdsl does not work:


  node() {
      git branch: "myjenkins", credentialsId: "my-credentials", url: "ssh://mygerrit.com:29418/jenkins/jobdsl-scripts"
      jobDsl targets: "src/jobs/groovy/*.groovy",
             additionalParameters: [
                disable_jobs: false,
             ],
             ignoreMissingFiles: true,
             ignoreExisting: false,
             removedJobAction: RemovedJobAction.DELETE,
             removedViewAction: RemovedViewAction.DELETE,
             lookupStrategy: LookupStrategy.JENKINS_ROOT,
             additionalClasspath: "src/jobs"
  }

The groovy dsl-files under src/jobs/groovy then import the class lib.Helper
Which is a file named Helper.groovy located in the src/jobs/lib folder.

But when running this, it complains that it can not find the class lib.Helper.

Im out of ideas to try. It works on another jenkins we are running. 

Lars Berntzon

unread,
May 2, 2023, 11:23:25 AM5/2/23
to job-dsl-plugin
Sorry, I missed the Global security settings -> "Enable script security for Job DSL scripts" must be un-checked for additionalClasspath to work.
Reply all
Reply to author
Forward
0 new messages