I am trying to link scm with every project present on our sonarqube. When i try to execute below command to attach scm link with the created project on the sonar
scm link does not get attached to the project, but when i change the branch to ‘master’ the scm link get attached to the project on sonar.
/usr/local/Cellar/sonar-scanner/4.6.2.2472_1/bin/sonar-scanner -Dsonar.sources=././vendor -Dsonar.login=adfafdsafasweq3e -Dsonar.host.url=https://abc.xyz.net -Dsonar.links.scm=https://git.com/abc/sonarqube-example-python.git -Dsonar.projectName=xyz:xyz -Dsonar.projectKey=Sonarqube:Python:integration -Dsonar.branch.name=master -Dsonar.sourceEncoding=UTF-8 -Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- -Dsonar.objc.file.suffixes=-
Is there any way to attach scm link with sonarqube project for integration branch?
If we scan the master branch first and then scan integration branch then integration branch will display the scm link we provided when we scanned master branch.
Everything seems to be working as expected as SCM links are tied to your main branch. Until SCM links have been provided via an analysis of your Main Branch, they will not appear.
If integration is your main branch, you can rename your main branch before the first analysis by going to Project Settings > Branches.