- Install Java Runtime Environment (http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
- Download and extract sonarqube (https://www.sonarqube.org/downloads/)
- Launch sonarqube:
C:\sonarqube\bin\windows-x86-xx\StartSonar.bat
- Browse to localhost:9000 to validate
- Install the SonarScanner for MSBuild (https://docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild) Edit the SonarQube.Analysis.xml file in the directory the scanner for MSBuild was installed to:
-
Ensure the sonar.host.url element points to localhost:9000
-
Ensure the directory the scanner was extracted to is added to:
System => Advanced System Settings => Environment Variables => System variables => Path
- Reboot
- Run the analysis from the root directory of the project project-key should be a unique name for the project
SonarScanner.MSBuild.exe begin /k:"<project-key>"
MSBuild.exe /t:Rebuild
SonarScanner.MSBuild.exe end
-
login as admin:admin
-
Ensure the appropriate files are excluded from analysis by doing the following:
Administration => Files => Source File Exclusions => /packages/ ... as appropriate