不能在Jenkinsfile中使用readMavenPom

oil*_*lio 23 jenkins jenkins-workflow jenkins-2

我正在使用Jenkins文件与Jenkins 2.0一起使用.该readMavenPom方法无法识别.是否有一些我缺少的配置可以使它可用?

我的詹金斯文件:

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"
}
Run Code Online (Sandbox Code Playgroud)

运行时,我收到以下错误:

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]
Run Code Online (Sandbox Code Playgroud)

oil*_*lio 62

我需要安装pipeline-utility-steps插件.