Hi,
I'm currently designing a Jenkins plug-in which calls some Job DSL script. In order to allow for more flexibility, I want to call the DSL directly, using code like:
JenkinsJobManagement jm = new JenkinsJobManagement(...)
JobParent jobParent = new JobParent() {
@Override
public Object run() {
return null;
}
}
jobParent.setJm(jm)
jobParent.folder('test') {
}
jobParent.freeStyleJob('test/test-job') {
description 'Test job'
}
This compiles fine, but running this results in a MissingMethodException:
groovy.lang.MissingMethodException:
No signature of method: net.nemerosa.seed.jenkins.step.ProjectSeedBuilder$1.folder() is applicable for argument types: (java.lang.String, net.nemerosa.seed.jenkins.step.ProjectSeedGenerator$_generate_closure1) values: [test, net.nemerosa.seed.jenkins.step.ProjectSeedGenerator$_generate_closure1@4ca13c39]
The signature method looks OK to me: String, then Closure.
Any idea of a solution to this problem?
My goal remains to be able to call the DSL directly from another plug-in.
Note that this works fine when running as a unit test, but not inside a Jenkins instance itself.
Best regards,
Damien.