jenkins: build and deploy using Java 9

This commit is contained in:
Paul Campbell 2018-03-04 17:50:56 +00:00
parent 211297df9f
commit 5e28fbb65d

View file

@ -23,23 +23,12 @@ pipeline {
} }
} }
stage('Build') { stage('Build') {
parallel {
stage('Java 8') {
steps {
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
sh "${mvn} clean install"
}
}
}
stage('Java 9') {
steps { steps {
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') { withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') {
sh 'mvn clean install' sh 'mvn clean install'
} }
} }
} }
}
}
stage('Archiving') { stage('Archiving') {
steps { steps {
archiveArtifacts 'pom.xml' archiveArtifacts 'pom.xml'
@ -48,7 +37,7 @@ pipeline {
stage('Deploy') { stage('Deploy') {
when { expression { (env.GIT_BRANCH == 'master') } } when { expression { (env.GIT_BRANCH == 'master') } }
steps { steps {
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') {
sh "${mvn} deploy --activate-profiles release -DskipTests=true" sh "${mvn} deploy --activate-profiles release -DskipTests=true"
} }
} }