By SonarSource – GNU LGPL 3 –
Issue Tracker –
The SonarQube Scanner is recommended as the default launcher to analyze a project with SonarQube.
- Expand the downloaded file into the directory of your choice. We'll refer to it as <install_directory> in the next steps.
Update the global settings to point to your SonarQube server by editing <install_directory>/conf/sonar-scanner.properties:
- Add the <install_directory>/bin directory to your path.
You can verify your installation by opening a new shell and executing the command
sonar-scanner -h(on Windows platform the command is
sonar-scanner.bat -h) . You should get output like this:
If you need more debug information you can add the
sonar.verbose property by adding the command line parameter
Create a configuration file in the root directory of the project: sonar-project.properties
Run the following command from the project base directory to launch the analysis:
Any user who's granted Execute Analysis permission can run an analysis.
If the Anyone group is not granted Execute Analysis permission or if the SonarQube instance is secured (the
sonar.forceAuthentication property is set to
true), the analysis token of a user with Execute Analysis permission must be provided through the
sonar.login property. Example:
sonar-scanner -Dsonar.login=[my analysis token]
Java heap space error or
Increase the memory via the SONAR_SCANNER_OPTS environment variable:
On Windows environments, avoid the double-quotes, since they get misinterpreted and combine the two parameters into a single one.
Unsupported major.minor version
Upgrade the version of Java being used for analysis or use one of the native package (that embed its own Java runtime). SonarQube 5.6+ requires Java 8.