Skip to content

Commit f0402df

Browse files
committed
Split Branches Into Multiple Sonarqube Projects
Eliminate analysis collisions and simplify application of analysis quite periods. Fixes: gh-6091
1 parent 0f7dff3 commit f0402df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Jenkinsfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ try {
3030
checkout scm
3131
withCredentials([string(credentialsId: 'spring-sonar.login', variable: 'SONAR_LOGIN')]) {
3232
try {
33-
sh "./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
33+
if ("master" == env.BRANCH_NAME) {
34+
sh "./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
35+
} else {
36+
sh "./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.projectKey='spring-security-${env.BRANCH_NAME}' -Dsonar.projectName='spring-security-${env.BRANCH_NAME}' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
37+
}
3438
} catch(Exception e) {
3539
currentBuild.result = 'FAILED: sonar'
3640
throw e

0 commit comments

Comments
 (0)