Skip to content

Instantly share code, notes, and snippets.

@jackawatts
Last active July 17, 2018 23:08
Show Gist options
  • Save jackawatts/916506da0eb82fbe55b813d252786f2c to your computer and use it in GitHub Desktop.
Save jackawatts/916506da0eb82fbe55b813d252786f2c to your computer and use it in GitHub Desktop.
Getting up and running with Sonarqube
  1. Install Java Runtime Environment (http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
  2. Download and extract sonarqube (https://www.sonarqube.org/downloads/)
  3. Launch sonarqube: C:\sonarqube\bin\windows-x86-xx\StartSonar.bat
  4. Browse to localhost:9000 to validate
  5. 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

  1. Reboot
  2. 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
  1. login as admin:admin

  2. Ensure the appropriate files are excluded from analysis by doing the following:

    Administration => Files => Source File Exclusions => /packages/ ... as appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment