Hi Jenkins experts,
I have a pipeline using Jenkins DSL plugin to generate jobs from the seed job.
In one of the job DSL, I had the following lines:
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
import org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause
import org.jenkinsci.plugins.workflow.cps.replay.ReplayCause
When trying to build the seed job, I got errors:
unable to resolve class org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause
@ line 14, column 1.
import org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause
// Same for the RunWrapper and ReplayCause
The mystery is when I tried to rebuild a generated job with the above DSL change (loaded as Jenkins shared library), the import works fine. I also notice the seed job has no issues importing the FlowInterruptedException
class which also comes from a plugin. Did I miss anything here? Would appreciate any insight on how to fix it.