[英]Jenkins groovy.lang.MissingMethodException: No signature of method: catchError()
[英]Jenkins DSL Pipeline plugin groovy.lang.MissingMethodException: No signature of method: script.pipelineJob()
對於我的本地/調試測試,我已生成xml步驟。 我不想添加插件管道插件,但我無法弄清楚它是哪個依賴項,或者我是否有錯誤的類路徑,或者?
我的代碼
import javaposse.jobdsl.dsl.DslFactory
import javaposse.jobdsl.dsl.jobs.WorkflowJob
pipeline = dslFactory.pipelineJob(name)
導致這種說法
Caused by: groovy.lang.MissingMethodException: No signature of method: script.pipelineJob() is applicable for argument types: (java.lang.String) values: [ps-landing-pipeline]
我的家屬(build.gradle)
dependencies {
compile 'org.codehaus.groovy:groovy:2.1.3'
compile 'org.jenkins-ci.plugins:job-dsl-core:1.45'
compile 'org.jenkins-ci.plugins.workflow:workflow-aggregator:2.4'
testCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude module: 'groovy-all'
}
// for the RestApiScriptRunner and XmlOutputRunner
compile('ant:ant:1.7.0')
}
我發現問題出在哪里,我的dsl-core版本不好
compile 'org.jenkins-ci.plugins:job-dsl-core:1.45'
VS
compile 'org.jenkins-ci.plugins:job-dsl-core:1.47'
- >我需要在API查看器中找到哪個版本: https : //jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.DslFactory.pipelineJob
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.