From 015aac3db6d3b63b24ecf5ad6740e7d2e2d4f517 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 09:40:32 +0000 Subject: [PATCH 1/2] jenkins: add missing maven wrapper for sonarqube deployment --- Jenkinsfile.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index b3d4bdd..ea4f979 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -39,7 +39,9 @@ pipeline { when { expression { env.GIT_BRANCH == 'develop' } } steps { withSonarQubeEnv('sonarqube') { - sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" + } } } } From a486e01a9196ac5fb13a2fcd5d51e5010bdd8188 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 09:42:39 +0000 Subject: [PATCH 2/2] jenkins: only deploy to sonarqube for remote repo --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index ea4f979..a97d8bd 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -36,7 +36,7 @@ pipeline { } } stage('SonarQube (develop only)') { - when { expression { env.GIT_BRANCH == 'develop' } } + when { expression { env.GIT_BRANCH == 'develop' && env.GIT_URL.startsWith('https://') } } steps { withSonarQubeEnv('sonarqube') { withMaven(maven: 'maven', jdk: 'JDK LTS') {