[英]How to configure Jenkinsfile to build maven modules in parallel?
我正在嘗試使用 Jenkins 並行構建我所有的 Maven 模塊。 我需要在我的 Jenkinsfile 中配置它。 我已經嘗試了以下方法:
node('cicd-build') {
println("Pipeline to run - ${utils.pipelineToRun}")
def branch = env.BRANCH_NAME
println("Branch - ${branch}")
stage('Checkout') {
scmCheckout {
deleteWorkspace = 'true'
maven_version = 'maven 3.6'
}
}
stage('Build') {
javaCompile {
goals = "clean install -T 4"
}
}
但是全新安裝 -T 4 並未應用於 Jenkins 管道
你想試試這個嗎
stage('Build') {
steps {
sh 'mvn -T 4 clean install'
}
}
我會做 Chetan 所做的,但我也會添加 -B 參數
-B, --batch-mode
Run in non-interactive (batch) mode
這樣做:
mvn -B -T 4 clean install
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.