jenkins: don't run builds in parallel

This commit is contained in:
Paul Campbell 2018-03-09 19:34:24 +00:00
parent 1cc7246d85
commit ab2873d221

View file

@ -13,7 +13,8 @@ pipeline {
when { when {
expression { expression {
(env.GIT_BRANCH == 'master' || env.CHANGE_TARGET == 'master') && (env.GIT_BRANCH == 'master' || env.CHANGE_TARGET == 'master') &&
(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") } (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT")
}
} }
steps { steps {
error("Build failed because SNAPSHOT version") error("Build failed because SNAPSHOT version")
@ -28,21 +29,17 @@ pipeline {
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
} }
} }
stage('Build') { stage('Build Java 8') {
parallel { steps {
stage('Java 8') { withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
steps { sh "${mvn} clean install"
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
sh "${mvn} clean install"
}
}
} }
stage('Java 9') { }
steps { }
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') { stage('Build Java 9') {
sh "${mvn} clean install" steps {
} withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') {
} sh "${mvn} clean install"
} }
} }
} }