Get Started in Two Minutes
1234567
# On Windows, execute:
C:\sonarqube\bin\windows-x86-xx\StartSonar.bat
# On other operating system, execute:
/etc/sonarqube/bin/[OS]/sonar.sh console
Installation
1234
#----- Default SonarQube server
#sonar.host.url=http://localhost:9000
123456789
usage: sonar-scanner [options]
Options:
-D,--define Define property
-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 the sonar.verbose property by adding the command line parameter -Dsonar.verbose=true.
Use
Create a configuration file in the root directory of the project: sonar-project.properties
sonar-project.properties
1234567891011121314
# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=My project
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
Run the following command from the project base directory to launch the analysis:
1234
sonar-scanner