--
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-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/7b8a5197-e3c7-481e-9d7a-6e02bdef677f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class StepsUtil {
static doConditionalMavenStep(context, String mavenGoals, String mavenVersion) {
context.with {
conditionalSteps {
condition {
booleanCondition('MYTOKEN')
}
runner('DontRun')
steps {
commonMavenStep(delegate, mavenVersion, mavenGoals)
}
}
}
}
static commonMavenStep(context, String mavenGoals, String mavenVersion) {
context.with {
maven {
mavenInstallation(mavenVersion)
goals(mavenGoals)
}
}
}
}
job('test') {
steps {
StepsUtil.doConditionalMavenStep(delegate, 'MAVENGOALS', 'MAVENVERSION')
StepsUtil.commonMavenStep(delegate, 'OTHERMAVENGOALS', 'MAVENVERSION')
}
}Expected no exception to be thrown, but got 'javaposse.jobdsl.dsl.DslScriptException' at spock.lang.Specification.noExceptionThrown(Specification.java:118) at JobScriptsSpec.test script #file.name
(JobScriptsSpec.groovy:32) Caused by: javaposse.jobdsl.dsl.DslScriptException: (StepsUtil.groovy, line 29) No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.commonMavenStep() is applicable for argument types: (javaposse.jobdsl.dsl.helpers.step.StepContext, java.lang.String, java.lang.String) values: [javaposse.jobdsl.dsl.helpers.step.StepContext@230f5ade, ...] at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.groovy:60) at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.groovy:112) at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.groovy:108) at JobScriptsSpec.test script #file.name(JobScriptsSpec.groovy:29) Caused by: groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.commonMavenStep() is applicable for argument types: (javaposse.jobdsl.dsl.helpers.step.StepContext, java.lang.String, java.lang.String) values: [javaposse.jobdsl.dsl.helpers.step.StepContext@230f5ade, ...]
class Util {
public Util() {}
static void commonMavenStep(context, String mavenGoals, String mavenVersion) {
context.with {
maven {
mavenInstallation(mavenVersion)
goals(mavenGoals)
configure {
it / 'usePrivateRepository'('true')
}
}
}
}
}
class StepsUtil extends Util{
public StepsUtil() {}
static void doConditionalMavenStep(context, String mavenGoals, String mavenVersion) {
context.with {
conditionalSteps {
condition {
booleanCondition('MYTOKEN')
}
runner('DontRun')
steps {
commonMavenStep(delegate, mavenVersion, mavenGoals)
}
}
}
}
}
def jobs = [:]
jobs['build'] = mavenJob('test') {
preBuildSteps {
StepsUtil.doConditionalMavenStep(delegate, 'MAVENGOALS', 'MAVENVERSION')
Util.commonMavenStep(delegate, 'OTHERMAVENGOALS', 'MAVENVERSION')
}
}
jobs.values().each { mavenJob ->
mavenJob.jdk('JDK1.7')
}