Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.gradle.api.plugins.sonar.model
[Groovy] Class SonarRootModel

    java.lang.Object
      org.gradle.api.plugins.sonar.model.SonarRootModel

All Implemented Interfaces:
  SonarModel

    class SonarRootModel
    extends java.lang.Object

Configuration options for a project that has the `sonar` plugin applied.

Property Summary
`java.io.File` | `bootstrapDir` Directory where the Sonar client library will be stored.
`java.lang.String` | `branch` Name of the version control branch that is analyzed.
`java.util.List` | `childModels` Configuration options for child projects of this project.
`SonarDatabase` | `database` Configuration options related to the Sonar database.
`java.lang.String` | `gradleVersion` The Gradle version to be reported to the Sonar client library.
`java.lang.String` | `profile` Selects one of the quality profiles configured via the Sonar web interface, overriding any selection made there.
`SonarProject` | `project` Per-project configuration options.
`java.util.List` | `propertyProcessors` Post-processors for global Sonar properties.
`SonarServer` | `server` Configuration options related to the Sonar server.

Method Summary
`void` | `database(groovy.lang.Closure config)` Configures database configuration options.
`void` | `project(groovy.lang.Closure config)` Configures per-project configuration options.
`void` | `server(groovy.lang.Closure config)` Configures server configuration options.
`void` | `withGlobalProperties(groovy.lang.Closure block)` Registers a closure for post-processing the global Sonar properties covered by `SonarRootModel`, and for adding further properties not covered by that model.``

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Property Detail

### bootstrapDir

    java.io.File bootstrapDir

  Directory where the Sonar client library will be stored. The correct version of the client library is automatically downloaded from the Sonar server before analysis begins. Defaults to `$project.buildDir/sonar`.

### branch

    @SonarProperty("sonar.branch")
    java.lang.String branch

  Name of the version control branch that is analyzed. Two branches of the same project are considered as different projects in Sonar. Defaults to `null`.

### childModels

    java.util.List childModels

  Configuration options for child projects of this project.

### database

    @IncludeProperties
    SonarDatabase database

  Configuration options related to the Sonar database.

### gradleVersion

    java.lang.String gradleVersion

  The Gradle version to be reported to the Sonar client library. Only used for identification purposes. Defaults to the current Gradle version.

### profile

    @SonarProperty("sonar.profile")
    java.lang.String profile

  Selects one of the quality profiles configured via the Sonar web interface, overriding any selection made there. Defaults to `null`.

### project

    SonarProject project

  Per-project configuration options.

### propertyProcessors

    java.util.List propertyProcessors

  Post-processors for global Sonar properties.
  See Also:
    withGlobalProperties

### server

    @IncludeProperties
    SonarServer server

  Configuration options related to the Sonar server.

Method Detail

### database

    void database(groovy.lang.Closure config)

  Configures database configuration options. The specified closure delegates to an instance of SonarDatabase.
  Parameters:
    `database` - configuration options

### project

    void project(groovy.lang.Closure config)

  Configures per-project configuration options. The specified closure delegates to an instance of SonarProject.
  Parameters:
    `per-project` - configuration options

### server

    void server(groovy.lang.Closure config)

  Configures server configuration options. The specified closure delegates to an instance of SonarServer.
  Parameters:
    `server` - configuration options

### withGlobalProperties

    void withGlobalProperties(groovy.lang.Closure block)

  Registers a closure for post-processing the global Sonar properties covered by `SonarRootModel`, and for adding further properties not covered by that model. The properties are passed to the closure as a map of String keys and values. Keys correspond to the Sonar properties as described in the Sonar documentation.

  Evaluation of the closure is deferred until build execution time. If this method is called multiple times, closures will be evaluated in the order they have been registered.

  Example:

       withGlobalProperties { props ->
           // add further properties
           props["some.sonar.property"] = "some value"
           props["another.sonar.property"] = "another value"

           // modify existing properties (rarely necessary)
           props["sonar.branch"] = "some-branch"
           props.remove("sonar.profile")
       }

  Parameters:
    `block` - a closure for post-processing global Sonar properties
  ``

Groovy Documentation