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' } }
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. |
Method | Description |
forkOptions(action) | Configure the |
sonarProperties(action) | Adds an action that configures SonarQube properties for the associated Gradle project. |
JavaForkOptions
forkOptions
Options for the Sonar Runner process.
void
forkOptions
(Action
<? super JavaForkOptions
>
action)
Action
<? super JavaForkOptions
>Configure the SonarRunnerRootExtension.forkOptions(org.gradle.api.Action)
.
void
sonarProperties
(Action
<? super SonarProperties
>
action)
Action
<? super SonarProperties
>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.