# SonarRunnerRootExtension

API Documentation: | `SonarRunnerRootExtension`

Note: This class is deprecated and will be removed in the next major version of Gradle.

Specialization of `SonarRunnerExtension` that is used for the root of the project tree being analyzed.

This extension provides extra configuration options that are only applicable to the analysis as a whole, and therefore is used for the project (typically the root) that the plugin is applied too.

Example usage:

    sonarRunner {
      toolVersion = '2.3' // default

      forkOptions {
        maxHeapSize = '1024m'
        jvmArgs '-XX:MaxPermSize=128m'
      }
    }

### Properties

Property | Description
`forkOptions` | Options for the Sonar Runner process.
`skipProject` | If the project should be excluded from analysis.
`toolVersion` | Version of Sonar Runner JARs to use.

### Methods

Method | Description
`forkOptions(action)` | Configure the `SonarRunnerRootExtension.forkOptions()`.
`sonarProperties(action)` | Adds an action that configures SonarQube properties for the associated Gradle project.

### Script blocks

No script blocks

### Property details

#### `JavaForkOptions` `forkOptions`

Options for the Sonar Runner process.

#### `boolean` `skipProject`

If the project should be excluded from analysis.

Defaults to `false`.

Default:
  `false`

#### `String` `toolVersion`

Version of Sonar Runner JARs to use.

Defaults to `2.3`.

Default:
  `2.3`

### Method details

#### `void` `forkOptions`(``Action`<? super `JavaForkOptions`>` action)

Configure the `SonarRunnerRootExtension.forkOptions()`.

#### `void` `sonarProperties`(``Action`<? super `SonarProperties`>` action)

Adds an action that configures SonarQube properties for the associated Gradle project.

Global SonarQube properties (e.g. database connection settings) have to be set on the "root" project of the Sonar run. This is the project that has the `sonar-runner` plugin applied.

The action is passed an instance of `SonarProperties`. Evaluation of the action is deferred until `sonarRunner.sonarProperties` is requested. Hence it is safe to reference other Gradle model properties from inside the action.

Sonar properties can also be set via system properties (and therefore from the command line). This is mainly useful for global SonarQube properties like database credentials. Every system property starting with `"sonar."` is automatically set on the "root" project of the SonarQube run (i.e. the project that has the `sonar-runner` plugin applied). System properties take precedence over properties declared in build scripts.