From ca46ee0d0fd3d559bd9f6084dbc5a55cfbbd3ddc Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 19:25:51 +0000 Subject: [PATCH] jenkins: update to template --- Jenkinsfile.groovy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 7198d71..9207dae 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -28,7 +28,14 @@ pipeline { sh "${mvn} checkstyle:checkstyle" sh "${mvn} pmd:pmd" pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' - withSonarQubeEnv('sonarqube') { + } + } + } + stage('SonarQube (develop only)') { + when { expression { env.GIT_BRANCH == 'develop' && env.GIT_URL.startsWith('https://') } } + steps { + withSonarQubeEnv('sonarqube') { + withMaven(maven: 'maven', jdk: 'JDK LTS') { sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" } } @@ -37,7 +44,7 @@ pipeline { stage('Build Java Next') { steps { withMaven(maven: 'maven', jdk: 'JDK Next') { - sh "${mvn} clean install" + sh "${mvn} clean install -Djava.version=9" } } }