Jenkins setup:
OS: Linux Red Hat Enterprise Linux release 8.10 (Ootpa)
Jenkins LTS version: 2.541.1
Nexus Platform Plugin version: 3.27.1-01
JOB-DSL plugin version: 1.77 (also tested with latest 3654.vdf58f53e2d15 version)
I have the following code snippet defined in a groovy file (e.g. JenkinsJobOne.groovy)
steps {
nexusPolicyEvaluation {
iqServerId('fil-nexus-server1')
iqApplication(nexus_iq_application)
iqStage(nexus_iq_stage)
scanPatterns(nexus_iq_scan_patterns)
failBuildOnNetworkError(true)
}
}
When I try to seed the job, I’m getting the below compilation error:
No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.nexusPolicyEvaluation() is applicable for argument types: (JenkinsJobOne$_run_closure1$_closure2$_closure14$_closure24) valu
JOB-DSL api viewer is not working with version 1.77. It does work with the latest version, however, the api viewer still does not provide the nexusPolicyEvaluation method. I had to downgrade back to JOB-DSL 1.77 because the latest version is not compatible with our postBuildScripts method. Does anyone know the JOB-DSL method that should be used for this plugin configuration? The same method works in declarative pipelines, but I could not get it working in JOB-DSL and we’d prefer having the nexusPolicyEvaluation as part of the job’s build steps and not a separate pipeline stage, so the build job workspace is scanned, and not the pipeline workspace.