SLING-8262 - Add SonarQube analysis to Jenkins jobs
Do not pass sonar.branch.name for master branch, hopefully
fixes:
Project was never analyzed. A regular analysis is required
before a branch analysis
diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 76e5499..d599441 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -69,7 +69,7 @@
// Note: soon we won't have to handle that manually, see https://jira.sonarsource.com/browse/SONAR-11853
if ( isPrBuild ) {
sonarcloudParams="${sonarcloudParams} -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID}"
- } else {
+ } else if ( env.BRANCH_NAME != "master" ) {
sonarcloudParams="${sonarcloudParams} -Dsonar.branch.name=${BRANCH_NAME}"
}
// Alls params are set, let's execute using #withCrendentials to hide and mask Robert's token