Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it.
Asked
Active
Viewed 1,151 times
4

Pascal Berger
- 4,262
- 2
- 30
- 54

Graham Smith
- 517
- 2
- 10
-
From what I've read, MSBuild.Runner does NOT replace SonarQube Runner. The actual code analysis is still performed by the Sonar runner, which MSBuild.Runner should be invoking internally. MSBuild.Runner just makes it easier for you to integrate SonarQube into your team build environment on TFS 2013 or greater and helps you map projects in TFS to sonar projects. – Techtwaddle Jun 18 '15 at 09:45
-
Thanks. I thought as much but the ALM rangers guide has this on p22 which had me scratching my head: "This step describes how to manually verify the sonar-runner setup. This is only to test that the sonar runner has been correctly installed. Once you have validated the setup, the recommended approach is to use the Sonar.MSBuild.Runner as documented in Integrate with Team Build, page 26 ; you won’t need the sonar-runner.properties any longer". – Graham Smith Jun 18 '15 at 09:59
-
There are two properties files: * sonar-runner.properties: defaults for that sonar-runner installation, and * sonar-project.properties: per-SonarQube project settings. Page 22 of the Rangers guide refers to the sonar-project.properties, which is the one that is generated by the MSBuild.Runner. – duncanp Jun 27 '15 at 10:39
-
Just to clarify, V1.0.5 of the Rangers guide (and presumably earlier) referred to **sonar-runner.properties**. This has now been changed to **sonar-project.properties** in V1.0.6. Users should ensure they are on the latest version of the guide. – Graham Smith Jun 27 '15 at 15:54
1 Answers
8
@Techtwaddle is correct: the MSBuild.Runner invokes the sonar-runner.
The MSBuild.Runner v0.9 does the following:
- fetches configuration settings from the SonarQube server;
- gathers information during the MSBuild phase;
- generates a sonar-project.properties file;
- invokes the sonar-runner to carry out further analysis.
Some of the analysis is now performed before calling the sonar-runner. For example, FxCop analysis is now happens as part of the MSBuild phase rather than being invoked from the sonar-runner.
Currently, you have to manually install both the sonar-runner and the MSBuild.Runner. Work is planned to change this so you will only need to install the MSBuild.Runner. See http://jira.sonarsource.com/browse/SONARMSBRU-42.

duncanp
- 1,572
- 1
- 10
- 8
-
And indeed, with that change, the fact that the MSBuild Runner internally relies on the sonar-runner will become an implementation detail. I even can imagine that at some point in the future, the MSBuild Runner won't rely on the sonar-runner anymore. – Dinesh Bolkensteyn Jun 18 '15 at 12:57
-
Thanks for the confirmation. I blog about TFS and wanted to make sure I had the facts straight. Blog post in case it helps anyone: http://pleasereleaseme.net/continuous-delivery-with-tfs-track-technical-debt-with-sonarqube – Graham Smith Jun 18 '15 at 22:53