SonarQube
  • Preface
  • 1. About SonarQube
  • 2. Get Started in Two minutes
  • 3. Installation of SonarQube
    • 3.0.1 Pre-requisities
    • 3.1 SonarQube - SQL Server configuration
    • 3.2 SonarQube - MySQL Server configuration
    • 3.2.1 SonarQube - PostgreSQL Server Configuration
    • 3.3 Install SonarQube as Standalone Service
    • 3.4 Firewall settings for SonarQube
    • 3.5 Configure ODBC Driver
  • 4. SonarScanner Installation
    • 4.1 Installation of SonarScanner in Windows
    • 4.2 Installation of SonarScanner in Jenkins
  • 5. Analysis using SonarQube
    • 5.1 Simple Analysis using SonarScanner
    • 5.2 Advanced Analysis using SonarQube
  • 6. Understanding the Report
  • 7. Integration with Jenkins
Powered by GitBook
On this page

Was this helpful?

  1. 4. SonarScanner Installation

4.1 Installation of SonarScanner in Windows

Previous4. SonarScanner InstallationNext4.2 Installation of SonarScanner in Jenkins

Last updated 5 years ago

Was this helpful?

  1. Expand the downloaded file into the directory of your choice. We'll refer to it as _<install_directory> _in the next steps.

  2. Update the global settings (server URL) by editing<install_directory>/conf/sonar-scanner.properties:

  3. Create a new SONAR_RUNNER_HOME _environment variable set to <install_directory>_.

  4. Add the _<install_directory>/bin _directory to your path.

  5. You can check the basic installation by opening a new shell and executing the commandsonar-scanner -h(on Windows platform the command issonar-scanner.bat -h) . You should get a message like this:

    usage: sonar-scanner [options]
    
    Options:
     -D,--define <arg>     Define property
     -e,--errors           Produce execution error messages
     -h,--help             Display help information
     -v,--version          Display version information
     -X,--debug            Produce execution debug output

If you need more debug information you can add thesonar.verboseproperty by adding the command line parameter-Dsonar.verbose=true.

Always keep in mind that if you change the port number of SonarQube installation then you must also change in sonar-scanner.properties under configuration folder(conf) of sonar scanner installation directory.

#----- Default SonarQube server
sonar.host.url=http://localhost:<to port number you have changed in SonarQube>

Restart the sonarQube server if you have changed configuration settings of sonarscanner

You are now ready to analyze a project with the SonarQube Scanner.

#----- Default SonarQube server#sonar.host.url=

http://localhost:9000