2

I recently configured our build server using bamboo and Sonar. In our case we have a multiple developer environment and chose to not only analyse our trunk but also the branch. The nightly builds of trunk and branch are analysed by sonar. And there lies our problem. The last build will be the build saved in Sonar, which is plausible from a Sonar point-of-view, ie the projects have the same name so are probably the same.

In Branch we have fixes for our major release all projects name and code are same just in branch we have bug fixes. so we would love to see the analysis of branch and trunk separately in sonar dashboard.

The question is there is a way to make multiple version of the same project in Sonar? Or is there any other best practice in this situations?

Looking forward to you replies :)

Harshil
  • 243
  • 2
  • 7
  • 19
  • possible duplicate of [SonarQube - analyzing branches of the same project](http://stackoverflow.com/questions/24786176/sonarqube-analyzing-branches-of-the-same-project) – user944849 Jul 14 '15 at 13:41

1 Answers1

4

Use the sonar.branch analysis property to distinguish the branches from head and from each other. Note that there are limitations. E.G. Issues marked "False Positive" in one version of the project will not show up as FP's in the other versions.

More analysis params in the docs

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Is there a better approach in the meantime? We're using SonarQube 6.0 and we have different branches of the same project. We're analysing them using the `sonar.branch` property. This works fine, but everytime a new branch is created and analysed, there are a lot of issues in the new project which we already marked as "won't fix" in existing projects. – rzueger Dec 30 '16 at 08:33
  • Unfortunately, there's not – G. Ann - SonarSource Team Jan 03 '17 at 12:03