Re: Method defined with job-dsl class ScmContext.metaClass throwing error No Signature for Method

15 views
Skip to first unread message

Daniel Spilker

unread,
Sep 7, 2017, 4:08:35 PM9/7/17
to job-dsl...@googlegroups.com

On Mon, Jul 24, 2017 at 9:43 AM, Sriranjani Sundaresan <sriranja...@gmail.com> wrote:
Hi,

Would like your guidance and suggestions on an issue that I have been facing for a while with implementing job-dsl ScmContext.metaClass

I have created a class SCMConfiguration.groovy and defined a static block similar to the below under ProjectName/common/config folder

static{

ScmContext.metaClass.gitSCM = { string project, string branch -->

git{

remote{
url project
branch branch
  }
}
}
}

Under ProjectName/Sample folder, have created a file SampleJob.groovy in which I had mentioned scoped usage of SCMConfiguration.groovy (since common is a dependent module of Sample folder)

use(config.SCMConfiguration) {}

freeStyleJob("SampleJob") {

scm {
gitSCM("ProjectName","branchName")

}
}

The above code snippet when implemented throws an error No Signature of Method: javaposse.jobdsl.dsl.helpers.ScmContext.gitSCM in Jenkins 2.42 and Job-DSL 1.57

While the same code when executed in Jenkins 1.64 and Job-DSL 1.56 works fine....Would like to know the root cause, and ideas on resolving the issue.
Could you please provide your guidance in this?


Thanks in Advance!

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/1eda5ccd-0595-4cae-9573-693a11ddcb55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages