in our Company we have the following issue with our SonarQube Server.
We used to run SonarQube in Version 6.2 Community Edition. We then updated to v6.7.5 without issues and then to v7.2 again without any re
ported issues during the update processes. We then activated our trial-license for the Developer Edition.
Until now we were unable to get the branching feature in our Projects to work. We tried a few things. And as far as we have seen, the database (MySql) only creates master-branches altough we correctly send the branch-name to the server. We tried it on existing projects as well as on newly created project instances.
Could you elaborate on that? Specifically what did you try (specific analysis parameters would be helpful) and what were the results (i.e. show us your analysis logs)?
Hey Ann,
Our sonar.properties are the default values
We use maven in our projects to push the files to our server. We used the <sonar.branch.name> property and followed the branch settings as described here (https://docs.sonarqube.org/display/SONAR/Branch+Analysis).
Please find attached, the snippet from our pom.xml and the log from “mvn sonar:sonar”, that the server got from the execution. Please note that I replaced the company-related information as well as my machines information with a “*” where necessary.
If you need any additional information please let us know.
You seem to have misunderstood the use of sonar.branch.target. The docs say:
Name of the branch where you intend to merge your short-lived branch at the end of its life. If left blank, this defaults to the master branch…
Since you probably don’t intend to merge this branch into itself, you should either not provide sonar.branch.target and let it default to master, or provide the name of some other long-lived branch.
Hi.
Thanks for the reply. That was definately a mistake. But i did try that just once. Did try it without the target, with devlop as target and even with master set as target explicitly. None of them worked. Still only get my master branch to show in the overview.
I was looking for your analysis command, not your analysis log. Nonetheless, I’ve just taken a look at the pom properties you sent earlier, and I see that you’re setting branch and target in the pom. Could you try a run where they’re removed from the pom, and instead included in the analysis command line. Then from that run send us
the analysis command line (e.g. mvn sonar:sonar -Dsonar.branch.name...)
I spun up my 7.2 DE instance and tried this, first analyzing master, and then mvn sonar:sonar -Dsonar.branch.name=feature/init, and it worked for me:
And then I went back to your very first post and noticed this for the first time (emphasis added):
So… I need to verify: you’re taking as evidence that branch analysis isn’t working what you see in the database? Because you should treat the DB like an impenetrable black box.
no we just checked the database as branching did not work for us. The thing is, that when we try analyzing the sonar-branches and go to the project dashboar, there is no dropdown-menu that allows us to choose the branches that were analyzed, but rather the “+”-icon that opens the popup containing information on how to add branches.
That is why we think that the branch analysis is not working. As we unfortunately have no way of switching to other branches.
Would you mind running a branch analysis, using Maven or sonar-scanner, and adding command line parameter -Dsonar.scanner.dumpToFile=sonar.properties. This will dump all configured properties in this file.
Then could you please remove sensitive data (like values of sonar.login / sonar.password) and share it with us?
To me the problem is on scanner side. If branch configuration was correctly enabled/configured, you should see in logs:
I just ran maven with the option you provided and there is no branch name or anything branch related in the log files. But please see for yourself in the attached properties-file.
Sry, forgot that I have commented out the line in our root pom.xml file (from trying to pass the branch argument via the command line), after adding that to the scan the sonar.properties file now has a line sonar.branch.name=feature/init
But no type:SHORT or something like that