我正在研究要与Jenkins 2.0一起使用的Jenkinsfile。readMavenPom无法识别该方法。我缺少一些配置以使其可用吗?
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]
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]
我需要安装pipeline-utility-steps插件。
pipeline-utility-steps