Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube: 8.9.7 enterprise edition.
SonarScanner: 3.3.0.1492 - how is SonarQube deployed: zip, Docker, Helm
Zip
I am trying to understand how should i include sonar branch analysis. I am using Jenkins and use like below in Analysis properties.
Master:
sonar.projectKey=com:shared:$GIT_BRANCH_CLEAN
sonar.projectName=Shared
sonar.projectVersion=
sonar.modules=
sonar.sources=.
sonar.java.binaries=.
sonar.exclusions=**/target/**
sonar.coverage.exclusions=**/test/**
sonar.language=java
Non Master
sonar.projectKey=com:shared:$GIT_BRANCH_CLEAN
sonar.projectName=Shared
sonar.branch.name=$GIT_BRANCH
sonar.newCode.referenceBranch=origin/master
sonar.projectVersion=
sonar.modules=
sonar.sources=.
sonar.java.binaries=.
sonar.exclusions=**/target/**
sonar.coverage.exclusions=**/test/**
sonar.language=java
issue i am trying to understand if i have one repoistory and in that i have master branch and couple of other branches, once it runs analsyis in jenkins, it is creating different projects for each branch and is not relating master and all the branches of same repositories under same dropdown and in one project.
How can i relate branches of same repositories with master branch of same repository. Ideally it should show me the master branch and in dropdown all the branches which are in that repository and pull requests.
Can you please guide me what configurations should i pass in jenkins master job and jenkins non-master jobs so that all branches in same repository shows analysis under one project with master as main branch and others as dropdown list in same project and it should not create new projets with each branch analysis
###########Logs Non Master branch in jenkins
INFO: Load project branches
INFO: Load project branches (done) | time=5ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=7ms
INFO: Load branch configuration
INFO: Found manual configuration of branch/PR analysis. Skipping automatic configuration.
INFO: Load branch configuration (done) | time=2ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=62ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load active rules
INFO: Load active rules (done) | time=1409ms
INFO: Branch name: origin/test-sonar
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/target/**
INFO: Excluded sources for coverage: **/test/**
INFO: 19 files indexed
Thanks