Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 54 Next »

This bootstrapper is recommended to run analysis on non-Java projects.

Table of Contents

Prerequisites

  • Java 1.5 or higher
  • Sonar 2.6 or higher. The server must be up when analyzing projects.

Download

Installation

  1. Uncompress the downloaded file into a directory named $SONAR_RUNNER_HOME in the next steps.
  2. Update the global settings (database connection, server URL) by editing the file $SONAR_RUNNER_HOME/conf/sonar-runner.properties
  3. Add the $SONAR_RUNNER_HOME/bin directory to your path.
  4. 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 :

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

Usage

For each project a file sonar-project.properties must be created in the root directory of the project. This project configuration file must contain all properties required by Sonar to analyse the project :

Then the command 'sonar-runner' or 'sonar-runner.bat' (windows) must be executed from the project base directory to launch the Sonar analysis. That's it !

If a sonar-project.properties file can't be created in the root directory of the project, there are two alternatives :

  • Either properties can be specified directly through the command line. Ex : 'sonar-runner -Dsonar.projectKey=myproject -Dsources=src1 ...'
  • Or the property 'project.settings' can be used to specify the path to the project configuration file. Ex:  'sonar-runner -Dproject.settings=../myproject.properties'.

For advanced features such as reusing existing unit test reports, any Sonar advanced parameters can be defined in this project configuration file or through command-line parameters. 

Icon

If you get an java.lang.OutOfMemoryError, you can set the SONAR_RUNNER_OPTS environment variable, like this in *nix environments:

On Windows environments, avoid the double-quotes, since they get misinterpreted, turning the two parameters into a single one.

Icon

Due to SONARPLUGINS-1024, not possible to set "." as a source directory with Sonar 2.6.

Icon

Here is the source code of a sample C project.

Advanced options

Here are some advanced optional properties that can be used for the Java Runner:

Changelog

Loading

Release 1.3 (${entries.size()} issues)

Type Key Summary Priority Status Resolution

Loading

Release 1.2 (${entries.size()} issues)

Type Key Summary Priority Status Resolution

Loading

Release 1.1 (5 issues)

Loading

Release 1.0 (1 issues)

Type Key Summary Priority Status Resolution
New Feature SONARPLUGINS-951 Create a Sonar Standalone Runner (In addition to the Maven & Ant Runners) Major Closed Fixed

  • No labels