![](/img/trans.png)
[英]how to specify the full path along with the mvn executable in pom.xml
[英]how to specify the pom.xml path in jenkins pipeline script
因為它基本上是一種普通的maven機制。 所以
sh 'mvn -f otherdirectory/pom.xml clean install'
pipeline {
agent any
tools {
maven 'mavenHome'
jdk 'JavaHome'
}
stages {
stage('Build') {
steps {
echo 'maven clean'
//ABC indicates the folder name where the pom.xml file resides
bat ' mvn -f ABC/pom.xml clean install'
}
post {
success {
echo 'Now Archiving'
}
}
}
}
}
您可以嘗試進入目錄並以這種方式執行命令:
sh '''
cd otherdirectory
mvn clean install
'''
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.