Sie sind auf Seite 1von 4

Installing SonarQube Server

Supported Platforms : Oracle JRE
Database : Microsoft SQL Server , MySQL, Oracle
Installing the Web Server
Download and unzip the latest distribution from
<install_directory> (below) refers to the path to the directory where the SonarQube distribution has
been unzipped.
Setting the access to the Database
Edit <install_directory>/conf/ to configure the database settings. Templates are
available for every supported database. Just uncomment and configure the template as per your need.
Example for PostgreSQL

Starting the Web Server
The default port is "9000" and the context path is "/". These values can be changed in

Execute the following script to start the server:
On Windows: <install_directory>/bin/windows-x86-XX/StartSonar.bat
Where XX is 32 or 64 bit depending on operating system.

Installing the Analyzers
Installing and Configuring SonarQube Runner
Download SonarQube Runner from

Installing and Configuring Installation
1. Uncompress 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 (database connection, server URL) by editing
#----- Default SonarQube server

#----- PostgreSQL

#----- MySQL

#----- Oracle

#----- Microsoft SQLServer

#----- Global database settings

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 command sonar-
runner -h (on Windows platform the command is sonar-runner.bat -h) . You should get a
message like this:
usage: sonar-runner [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

Integrating SonarQube with Visual Studio
Download and install update for Visual Studio from here
Download and install SonarQube extension for visual studio VSSonarExtension from here

Analyzing projects using Sonar Runner
1. Create a configuration file in the root directory of the project:
# Required metadata
sonar.projectName=My project

# Path to the parent source code directory.
# Path is relative to the file. Replace "\" by "/"
on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory
# the file.

# Encoding of the source code

# Additional parameters

2. Run the following command from the project base directory to launch the analysis: