11
我正在爲Jenkins 2.0使用Jenkinsfile。 readMavenPom
方法無法識別。有沒有一些配置我錯過,使其可用?不能在Jenkinsfile中使用readMavenPom
我Jenkinsfile:
node {
stage 'Checkout'
checkout scm
env.PATH = "${tool 'maven-3'}/bin:${env.PATH}"
stage 'Build'
def pom = readMavenPom file: 'pom.xml'
echo "${pom}"
sh "mvn -DskipTests=true verify"
}
運行時,我收到以下錯誤:
java.lang.NoSuchMethodError: No such DSL method 'readMavenPom' found among [AWSEBDeployment, archive, bat, build, catchError, checkout, deleteDir, dir, echo, emailext, error, fileExists, git, input, isUnix, load, mail, node, parallel, properties, pwd, readFile, retry, sh, slackSend, sleep, stage, stash, step, svn, timeout, tool, unarchive, unstash, waitUntil, withCredentials, withEnv, wrap, writeFile, ws]