2016-05-12 31 views
11

Sto lavorando su un Jenkinsfile per l'utilizzo con Jenkins 2.0. Il metodo readMavenPom non è riconosciuto. C'è qualche configurazione che mi manca per renderla disponibile?Impossibile usare readMavenPom in Jenkinsfile

mio 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" 
} 

Quando viene eseguito, ottengo il seguente errore:

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] 

risposta

23

avevo bisogno di installare il plugin pipeline-utility-steps.