我正在试用 jenkins 工作流插件并开始教程https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md
我正在使用 jenkins 1.628 CloudBees Build Flow 0.18 tomcat 7.0.56 java 1.8.0_25 并全新安装了所有最新的工作流插件。
当我尝试第一个示例时
echo 'hello from Workflow'
我收到这个错误
ERROR: Failed to run DSL Script
groovy.lang.MissingMethodException: No signature of method:
com.cloudbees.plugins.flow.FlowDelegate.echo() is applicable for
argument types: (java.lang.String) values: [hello from Workflow]
如果我将代码更改为
println 'hello from Workflow'
作业运行。
如果我尝试下一个示例
node {
git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn -B verify"
}
发生此错误
ERROR: Failed to run DSL Script groovy.lang.MissingMethodException:
No signature of method:
com.cloudbees.plugins.flow.FlowDelegate.node()
is applicable for argument types: (Script1$_run_closure1) values:
[Script1$_run_closure1@1dbe8f29]
我错过了什么?