<!-- llms-index: https://docs.gradle.com/develocity/llms.txt -->

<a id="component-eol-banner"></a>

You are viewing **Develocity Gradle Plugin 4.3**. To view the latest available version of the docs, see [4.4](https://docs.gradle.com/develocity/gradle/4.4/gradle-plugin/).

# Develocity Gradle Plugin User Manual

<a id="preamble"></a>

The Develocity Gradle plugin enables integration with [Develocity](https://gradle.com) and [gradle.com/scans/gradle/](https://gradle.com/scans/gradle/).

<a id="getting-set-up"></a>

## Getting Set Up

Version 4.3.2 is the latest version and is compatible with all Gradle 5.x and later versions. See [Gradle 4.x and Earlier](#older_gradle) if you are using an earlier version of Gradle.

The instructions in this section describe applying and configuring the plugin for a single Gradle project. See [Integrating Your CI Tool](#ci_tool) for help with integrating all projects built within an environment.

<a id="applying_the_plugin"></a>

### Applying the Plugin

<a id="gradle_6_x_and_later"></a>

#### Gradle 6.x and Later

The `com.gradle.develocity` plugin must be applied in the [_settings file_](https://docs.gradle.org/current/userguide/intro_multi_project_builds.html) of the build.

<a id="tabs-1"></a>

*   <a id="tabs-1-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-1-groovy"></a>
    
    Groovy
    

<a id="tabs-1-kotlin--panel"></a>

**settings.gradle.kts:**

```
plugins {
    id("com.gradle.develocity") version("4.3.2")
}

develocity {
    // configuration
}
```

<a id="tabs-1-groovy--panel"></a>

**settings.gradle:**

```
plugins {
    id "com.gradle.develocity" version "4.3.2"
}

develocity {
    // configuration
}
```

The plugin is configured via the [develocity extension](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/DevelocityConfiguration.html) available in the settings script, which is also available via the root project in project build scripts. The same instance is used for the settings extension and root project extension.

<a id="gradle-5-x"></a>

#### Gradle 5.x

The `com.gradle.develocity` plugin must be applied to the root project of the build.

<a id="tabs-2"></a>

*   <a id="tabs-2-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-2-groovy"></a>
    
    Groovy
    

<a id="tabs-2-kotlin--panel"></a>

**build.gradle.kts:**

```
plugins {
    id("com.gradle.develocity").version("4.3.2")
}

develocity {
    // configuration
}
```

<a id="tabs-2-groovy--panel"></a>

**build.gradle:**

```
plugins {
    id "com.gradle.develocity" version "4.3.2"
}

develocity {
    // configuration
}
```

The plugin is configured via the [develocity extension](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/DevelocityConfiguration.html) of the root project in project build scripts.

<a id="connecting_to_develocity"></a>

### Connecting to Develocity

To connect to a Develocity instance, you must configure the location of the Develocity server.

<a id="tabs-3"></a>

*   <a id="tabs-3-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-3-groovy"></a>
    
    Groovy
    

<a id="tabs-3-kotlin--panel"></a>

```kotlin
develocity {
    server.set("https://develocity.example.com")
}
```

<a id="tabs-3-groovy--panel"></a>

```groovy
develocity {
    server = "https://develocity.example.com"
}
```

<a id="allowing-untrusted-ssl-communication"></a>

#### Allowing Untrusted SSL Communication

If your Develocity server uses an SSL certificate that is not trusted by your build’s Java runtime, you will not be able to publish Build Scans without explicitly allowing untrusted servers.

To do this, set the `allowUntrustedServer` option to `true`:

<a id="tabs-4"></a>

*   <a id="tabs-4-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-4-groovy"></a>
    
    Groovy
    

<a id="tabs-4-kotlin--panel"></a>

**Disabling SSL certificate checks:**

```
develocity {
    server.set("https://develocity.example.com")
    allowUntrustedServer.set(true)
}
```

<a id="tabs-4-groovy--panel"></a>

**Disabling SSL certificate checks:**

```
develocity {
    server = "https://develocity.example.com"
    allowUntrustedServer = true
}
```

Use of this configuration is a security risk as it makes it easier for a third party to intercept your Build Scan data. It should only be used as a short term workaround until the server can be configured with a trusted certificate.

<a id="authenticating"></a>

#### Authenticating

Develocity installations may be configured to require Build Scan publishing to be authenticated. Additionally, installations may be configured to only allow certain users to publish Build Scans.

> [!WARNING]
> Develocity access keys should be treated with the same secrecy as passwords. They are used to authorize access to Develocity from a build.

<a id="automated-access-key-provisioning"></a>

##### Automated Access Key Provisioning

The easiest way to configure a build environment to authenticate with Develocity is to use the `provisionDevelocityAccessKey` task.

```shell
./gradlew provisionDevelocityAccessKey
```

When executed, it opens your web browser and asks to confirm provisioning of a new access key. You will be asked to sign in to Develocity in your browser first if you are not already signed in.

When confirmed, a new access key will be generated and stored in the `develocity/keys.properties` file within the Gradle user home directory (`~/.gradle` by default).

Any existing access key for the same server will be replaced in the file, but will not be revoked at the server for use elsewhere. To revoke old access keys, sign in to Develocity and access “My settings” via the user menu at the top right of the page.

> [!NOTE]
> If your browser cannot be opened automatically at the correct page, you will be asked to manually open a link provided in the build console.

<a id="manual-access-key-configuration"></a>

##### Manual Access Key Configuration

Access keys can also be configured manually for an environment, when automated provisioning is not suitable.

<a id="creating-access-keys"></a>

###### Creating Access Keys

To create a new access key, sign in to Develocity and access “My settings” via the user menu at the top right of the page. From there, use the “Access keys” section to generate an access key.

> [!NOTE]
> Develocity server 2025.1+ supports access key expiration.

> [!WARNING]
> After upgrading to Develocity server 2025.1+ all existing access keys will be updated to have an expiration date.

The access key value should then be copied and configured in your build environment via file, environment variable or the settings file.

<a id="via_file"></a>

###### Via File

Develocity access keys are stored inside the Gradle user home directory (`~/.gradle` by default), at `develocity/keys.properties`, in a Java properties file. The property name refers to the _host name_ of the server, and the value is the access key.

```properties
develocity.example.com=7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq
```

The file may contain multiple entries. The first entry for a given host value will be used.

<a id="via-environment-variable"></a>

###### Via Environment Variable

The access key may also be specified via the `DEVELOCITY_ACCESS_KEY` environment variable. This is typically more suitable for CI build environments.

The environment variable value format is `«server host name»=«access key»`.

```shell
export DEVELOCITY_ACCESS_KEY=develocity.example.com=7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq && \
  ./gradlew build
```

The server hostname is specified to prevent the access key being transmitted to a different server than intended. In the rare case that you require access keys for multiple servers, you can specify multiple entries separated by semicolons.

```shell
export DEVELOCITY_ACCESS_KEY=ge1.example.com=7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq;ge2.example.com=9y4agfiubqqjea4vonghohvuyra5bnvszop4asbqee3m3sm67w5k && \
  ./gradlew build
```

<a id="via-settings-file"></a>

###### Via Settings File

The `accessKey` option of the plugin allows the access key to be set via the [settings file](https://docs.gradle.org/current/userguide/intro_multi_project_builds.html).

<a id="tabs-5"></a>

*   <a id="tabs-5-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-5-groovy"></a>
    
    Groovy
    

<a id="tabs-5-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
    accessKey.set("7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq")
}
```

<a id="tabs-5-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
    accessKey = "7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq"
}
```

An access key configured for the server this way will take precedence over an access key set via the environment variable or access key file.

<a id="short-lived-access-tokens"></a>

##### Short-Lived Access Tokens

Develocity access keys are long-lived, creating risks if they are leaked. To avoid this, users can use short-lived access tokens to authenticate with Develocity. Access tokens can be used wherever an access key would be used. Access tokens are only valid for the Develocity instance that created them.

> [!NOTE]
> Develocity server version 2024.1+ supports access tokens.

> [!WARNING]
> Changing a Develocity instance’s hostname will cause all existing access tokens to become invalid.

To create an access token:

1.  Get an access key or access token for the user you want to create a token for.
    
2.  Decide which permissions the new access token should have.
    
3.  If project-level access control is enabled, decide which projects the new access token should be able to access.
    
4.  Decide how long the new access token should live.
    
5.  Make a POST request to `/api/auth/token`, optionally with the following parameters. The response will be the access token.
    
    1.  A `permissions=` query parameter with the [config values](https://docs.gradle.com/develocity/2026.1/administration/access-control/permissions-and-roles/#permissions) of each permission you want to grant. By default, all permissions for the credential used to authenticate the token request are granted to the created token.
        
    2.  If project-level access control is enabled, a `projectIds=` query parameter with the ID of each project you want to grant access to. By default, all projects for the credential used to authenticate the token request are granted to the created token.
        
    3.  An `expiresInHours=` query parameter with the token’s intended lifetime in hours, with a maximum of 24. The default is two hours, or the remaining lifetime of the credential used to authenticate the request, whichever is smaller.
        
    

The requested permissions and project ids can be specified as comma-separated lists or repeated parameters. For example, `?projectIds=a,b&projectIds=c` is valid and will request projects `a`, `b`, and `c`.

> [!NOTE]
> If project-level access control is not enabled, all access tokens will be granted the “Access all data without an associated project” permission even if it is not explicitly requested.

If the user creating the token does not have one of the requested permissions or projects, Develocity will respond with a _403 Forbidden_ error. If an access token is used to authenticate the creation request, its permissions and projects will be used for this check instead of the user’s. The request will also error if the requested lifetime would cause the new access token to expire after the one used to authenticate the request. Together, this means you cannot create an access token with more access or a later expiration than the credentials used to authenticate the request.

> [!NOTE]
> See the [Develocity API documentation](https://docs.gradle.com/develocity/2026.1/reference/develocity-api/) for more details on the `/api/auth/token` endpoint.

Here is an example using CURL to create an access token:

```shell
curl -X POST https://ge.example.com/api/auth/token?permissions=publishScan,writeCache,accessDataWithoutAssociatedProject&projectIds=project-a,project-b&expiresInHours=1 \
  -H "Authorization: Bearer 7asejatf24zun43yshqufp7qi4ovcefxpykbwzqbzilcpwzb52ja"

eyJraWQiOiJ0ZXN0LWtleSIsImFsZyI6IlJTMjU2IiwidHlwIjoiSldUIn0.eyJpc19hbm9ueW1vdXMiOmZhbHNlLCJwZXJtaXNzaW9ucyI6WyJSRUFEX1ZFUlNJT04iLCJFWFBPUlRfREFUQSIsIkFDQ0VTU19EQVRBX1dJVEhPVVRfQVNTT0NJQVRFRF9QUk9KRUNUIl0sInByb2plY3RzIjp7ImEiOjEsImIiOjJ9LCJ1c2VyX2lkIjoic29tZS1pZCIsInVzZXJuYW1lIjoidGVzdCIsImZpcnN0X25hbWUiOiJhIiwibGFzdF9uYW1lIjoidXNlciIsImVtYWlsIjoiYkBncmFkbGUuY29tIiwic3ViIjoidGVzdCIsImV4cCI6NzIwMCwibmJmIjowLCJpYXQiOjAsImF1ZCI6ImV4YW1wbGUuZ3JhZGxlLmNvbSIsImlzcyI6ImV4YW1wbGUuZ3JhZGxlLmNvbSIsInRva2VuX3R5cGUiOiJhY2Nlc3NfdG9rZW4ifQ.H1_NEG1xuleP-WIAY_uvSmdd2o7i_-Ko3qhlo04zvCgrElJe7_F5jNuqsyDfnb5hvKlOe5UKG_7QPTgY9-3pFQ
```

The resulting token would have the following permissions:

*   “Publish Build Scans”
    
*   “Read and write Build Cache data”
    
*   “Access all data without an associated project”
    

And it would have access to these projects:

*   “project-a”
    
*   “project-b”
    

The token would only be usable for one hour.

<a id="connecting-to-scans-gradle-com"></a>

### Connecting to Develocity at Gradle.com

If the location of a Develocity server is not specified, Build Scans will be published to [Develocity at gradle.com](https://gradle.com/scans/gradle/). This requires agreeing the terms of service, which can be found at [https://gradle.com/legal/terms-of-use/](https://gradle.com/legal/terms-of-use/).

You can agree to the terms of service by adding the following configuration to your build.

<a id="tabs-6"></a>

*   <a id="tabs-6-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-6-groovy"></a>
    
    Groovy
    

<a id="tabs-6-kotlin--panel"></a>

**Agreeing to the terms of service:**

```
develocity {
    buildScan {
        termsOfUseUrl.set("https://gradle.com/legal/terms-of-use/")
        termsOfUseAgree.set("yes")
    }
}
```

<a id="tabs-6-groovy--panel"></a>

**Agreeing to the terms of service:**

```
develocity {
    buildScan {
        termsOfUseUrl = "https://gradle.com/legal/terms-of-use/"
        termsOfUseAgree = "yes"
    }
}
```

If you do not agree to the terms of service in your build, you will be asked interactively when trying to publish a Build Scan to [Develocity at gradle.com](https://gradle.com/scans/gradle/) each time you try to publish.

> [!WARNING]
> Be careful not to commit agreement to the terms of service into a project that may be built by others.

<a id="using-build-scans"></a>

## Using Build Scans

<a id="controlling_when_build_scans_are_published"></a>

### Controlling When Build Scans Are Published

Once you’ve gone through the initial setup of the previous section, you are ready to start publishing Build Scans. But when should you publish them? Every time you run a build? Only when the build fails? It’s up to you. The Develocity Gradle plugin has several options that allow you to use whatever approach works best.

<a id="publishing-every-build"></a>

#### Publishing Every Build

This is the default. There are many advantages to publishing Build Scans regularly, such as being able to track the behavior and performance of a build over time. It makes no sense relying on ad-hoc publishing of scans in such a situation as it’s easy to forget on the command line. Should you decide to explicitly enforce this default option, you can do this as follows:

<a id="tabs-7"></a>

*   <a id="tabs-7-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-7-groovy"></a>
    
    Groovy
    

<a id="tabs-7-kotlin--panel"></a>

**Publishing a Build Scan for every build execution:**

```
develocity {
    buildScan {
        publishing.onlyIf { true }
    }
}
```

<a id="tabs-7-groovy--panel"></a>

**Publishing a Build Scan for every build execution:**

```
develocity {
    buildScan {
        publishing.onlyIf { true }
    }
}
```

If you want to skip publishing a particular build, you can then add the `--no-scan` argument to any Gradle build.

```shell
./gradlew assemble --no-scan
```

<a id="publishing-on-demand"></a>

#### Publishing On-Demand

We imagine that when you first start experimenting with Build Scans, you won’t want to publish them all the time until you become familiar with the implications. Even then, you may have good reason not to go all-in and automate the process. That’s where one-off Build Scans come in.

If you only want to publish Build Scans when explicitly requested, use the following option:

<a id="tabs-8"></a>

*   <a id="tabs-8-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-8-groovy"></a>
    
    Groovy
    

<a id="tabs-8-kotlin--panel"></a>

**Publishing a Build Scan on-demand:**

```
develocity {
    buildScan {
        publishing.onlyIf { false }
    }
}
```

<a id="tabs-8-groovy--panel"></a>

**Publishing a Build Scan on-demand:**

```
develocity {
    buildScan {
        publishing.onlyIf { false }
    }
}
```

You can then add the `--scan` argument to any Gradle build to publish a Build Scan.

```shell
./gradlew assemble --scan
```

> [!NOTE]
> If the build does not apply the plugin, Gradle will automatically apply the most recent version available at the time that version of Gradle was released. Gradle versions older than 8.4 do not recognize the Develocity plugin as the replacement for deprecated Gradle Enterprise and Build Scan plugins. When --scan argument is used, Gradle attempts to apply its version of the plugin which may conflict with the Develocity plugin explicitly applied to your project. If the plugin applied by Gradle wins, the new functionality provided by the Develocity plugin will not be available. This case will be highlighted using the following message: To resolve the issue, upgrade to a newer Gradle version or configure on-demand publication using one of the options described in Publishing Based on Criteria section.

You can also publish a Build Scan for the most recently run build by invoking the `buildScanPublishPrevious` task added by the plugin.

```shell
./gradlew buildScanPublishPrevious
```

Since the task name is quite long, it’s worth taking advantage of Gradle’s [abbreviated command line notation for tasks](https://docs.gradle.org/current/userguide/command_line_interface.html#sec:name_abbreviation):

```shell
./gradlew bSPP
```

<a id="publishing_based_on_criteria"></a>

#### Publishing Based on Criteria

Many of you will want a bit more control over exactly when Build Scans are published without resorting to using `--scan` each time. You may want to publish Build Scans only under the following conditions:

1.  When the build fails
    
2.  When the user running the build is authenticated with Develocity
    
3.  If the build is running on CI
    

Such scenarios are covered by configuring a custom predicate.

<a id="tabs-9"></a>

*   <a id="tabs-9-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-9-groovy"></a>
    
    Groovy
    

<a id="tabs-9-kotlin--panel"></a>

**Restricting Build Scans to failed builds:**

```
develocity {
    buildScan {
        publishing.onlyIf { it.buildResult.failures.isNotEmpty() }
    }
}
```

<a id="tabs-9-groovy--panel"></a>

**Restricting Build Scans to failed builds:**

```
develocity {
    buildScan {
        publishing.onlyIf { !it.buildResult.failures.empty }
    }
}
```

<a id="tabs-10"></a>

*   <a id="tabs-10-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-10-groovy"></a>
    
    Groovy
    

<a id="tabs-10-kotlin--panel"></a>

**Restricting Build Scans to authenticated users:**

```
develocity {
    buildScan {
        publishing.onlyIf { it.isAuthenticated }
    }
}
```

<a id="tabs-10-groovy--panel"></a>

**Restricting Build Scans to authenticated users:**

```
develocity {
    buildScan {
        publishing.onlyIf { it.authenticated }
    }
}
```

<a id="tabs-11"></a>

*   <a id="tabs-11-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-11-groovy"></a>
    
    Groovy
    

<a id="tabs-11-kotlin--panel"></a>

**Restricting Build Scans to CI builds:**

```
develocity {
    buildScan {
        publishing.onlyIf { !System.getenv("CI").isNullOrEmpty() }
    }
}
```

<a id="tabs-11-groovy--panel"></a>

**Restricting Build Scans to CI builds:**

```
develocity {
    buildScan {
        publishing.onlyIf { System.getenv("CI") }
    }
}
```

You can use the other options in the same way. If you want to configure several things based on a set of criteria, you can use an `if` condition instead:

<a id="tabs-12"></a>

*   <a id="tabs-12-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-12-groovy"></a>
    
    Groovy
    

<a id="tabs-12-kotlin--panel"></a>

**Encapsulating several settings based on some criteria:**

```
develocity {
    buildScan {
        if (!System.getenv("CI").isNullOrEmpty()) {
            publishing.onlyIf { true }
            tag("CI")
        }
    }
}
```

<a id="tabs-12-groovy--panel"></a>

**Encapsulating several settings based on some criteria:**

```
develocity {
    buildScan {
        if (System.getenv("CI")) {
            publishing.onlyIf { true }
            tag "CI"
        }
    }
}
```

<a id="configuring_background_uploading"></a>

### Configuring Background Uploading

By default, Build Scans are uploaded in the background after the build has finished. This allows the build to finish sooner, but can be problematic in build environments (e.g. ephemeral CI agents) that terminate as soon as the build is finished, as the upload may be terminated before it completes. Background uploading should be disabled for such environments.

<a id="disable_background_uploading_programmatically"></a>

#### Disabling Programmatically

The `develocity.buildScan.uploadInBackground` property can be set to `false`.

<a id="tabs-13"></a>

*   <a id="tabs-13-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-13-groovy"></a>
    
    Groovy
    

<a id="tabs-13-kotlin--panel"></a>

**Disabling background uploading:**

```
develocity {
    buildScan {
        uploadInBackground.set(false)
    }
}
```

<a id="tabs-13-groovy--panel"></a>

**Disabling background uploading:**

```
develocity {
    buildScan {
        uploadInBackground = false
    }
}
```

It may be desirable to conditionally set the value based on the environment.

<a id="tabs-14"></a>

*   <a id="tabs-14-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-14-groovy"></a>
    
    Groovy
    

<a id="tabs-14-kotlin--panel"></a>

**Conditionally set background uploading:**

```
develocity {
    buildScan {
        uploadInBackground.set(System.getenv("CI") == null)
    }
}
```

<a id="tabs-14-groovy--panel"></a>

**Conditionally set background uploading:**

```
develocity {
    buildScan {
        uploadInBackground = System.getenv("CI") == null
    }
}
```

<a id="disable_background_uploading_system_property"></a>

#### Disabling via System Property

Background uploading can be disabled by setting the `scan.uploadInBackground` system property to `false`. The system property setting always takes precedence over the programmatic setting.

The system property may be specified when invoking the build:

```shell
./gradlew build -Dscan.uploadInBackground=false
```

Or, can be set as part of the environment with the `JAVA_OPTS` or `GRADLE_OPTS` environment variables:

```shell
export GRADLE_OPTS=-Dscan.uploadInBackground=false
```

Or, can be set in the user’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.scan.uploadInBackground=false
```

<a id="configuring-project-identifier"></a>

### Configuring Project Identifier

The documentation at the [Project-level access control](https://docs.gradle.com/develocity/2026.1/administration/access-control/project-level-access-control/) provides detailed information regarding project-level access control.

<a id="configuring_project_identifier_programmatically"></a>

#### Setting Programmatically

The `develocity.projectId` property can be set to a necessary value.

<a id="tabs-15"></a>

*   <a id="tabs-15-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-15-groovy"></a>
    
    Groovy
    

<a id="tabs-15-kotlin--panel"></a>

**Specifying project identifier:**

```
develocity {
    projectId.set("myProject")
}
```

<a id="tabs-15-groovy--panel"></a>

**Specifying project identifier:**

```
develocity {
    projectId = "myProject"
}
```

<a id="configuring_project_identifier_system_property"></a>

#### Setting via System Property

Project identifier can be also set using the `develocity.projectId` system property. The system property setting always takes precedence over the programmatic setting.

The system property may be specified when invoking the build:

```shell
./gradlew build -Ddevelocity.projectId=myProject
```

Or, can be set as part of the environment with the `JAVA_OPTS` or `GRADLE_OPTS` environment variables:

```shell
export GRADLE_OPTS=-Ddevelocity.projectId=myProject
```

Or, can be set in the user’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.develocity.projectId=myProject
```

<a id="capturing_file_fingerprints"></a>

### Capturing File Fingerprints

Build Scans capture hashes of inputs of tasks (and other units of work), to enable identifying changes to inputs when comparing builds, among other features. The overall hash value of each input property enables identifying which properties changed for a task (e.g. the source or the classpath for Java compilation). In addition, the paths and content hashes of individual input files of each property are captured by default. They allow identifying which _individual files_ changed for a task when comparing two builds.

<a id="capturing_file_fingerprints_when_disable"></a>

#### When to Disable

Capturing file fingerprints increases the amount of data transmitted to the Build Scan server at the end of the build. If the network connection to the Build Scan server is poor, it may increase the time required to transmit. Additionally, it may also increase the data storage requirements for a Build Scan server. In such cases, capturing file fingerprints can be disabled.

However, if you are using Develocity and utilizing its Build Cache to accelerate your builds, it is strongly recommended to keep it enabled as identifying which files have changed between builds with build comparison is extremely effective for diagnosing unexpected Build Cache misses.

If you are using Develocity for [Predictive Test Selection](https://docs.gradle.com/develocity/2026.1/using-develocity/predictive-test-selection/) enabling capture of file fingerprints is a prerequisite.

<a id="capturing_file_fingerprints_how_disable"></a>

#### How to Disable

Capture of file fingerprints can be enabled/disabled programmatically via the `buildScan` extension, or via a system property.

<a id="programmatically"></a>

##### Programmatically

To enable/disable programmatically, use the `buildScan` extension added by the Develocity Gradle plugin.

<a id="tabs-16"></a>

*   <a id="tabs-16-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-16-groovy"></a>
    
    Groovy
    

<a id="tabs-16-kotlin--panel"></a>

**Disabling file fingerprints capturing:**

```
develocity {
    buildScan {
        capture {
            fileFingerprints.set(false)
        }
    }
}
```

<a id="tabs-16-groovy--panel"></a>

**Disabling file fingerprints capturing:**

```
develocity {
    buildScan {
        capture {
            fileFingerprints = false
        }
    }
}
```

See the [file fingerprints API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanCaptureConfiguration.html#getFileFingerprints\(\)).

<a id="via-system-property"></a>

##### Via System Property

To enable/disable without modifying the build script, supply a `scan.capture-file-fingerprints` system property to the build. If the property is set to `false`, capture is disabled. Otherwise, capture is enabled. The environmental setting always takes precedence over the programmatic setting.

The system property may be specified when invoking the build:

```shell
./gradlew build -Dscan.capture-file-fingerprints=false
```

Or, can be set as part of the environment with the `JAVA_OPTS` or `GRADLE_OPTS` environment variables:

```shell
export GRADLE_OPTS=-Dscan.capture-file-fingerprints=false
```

Or, can be set in the project’s `gradle.properties` file, or the user’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.scan.capture-file-fingerprints=false
```

See the [Build Environment](https://docs.gradle.org/current/userguide/build_environment.html) chapter of the Gradle User Manual for more information on specifying system properties.

<a id="capturing-build-and-test-outputs"></a>

### Capturing Build and Test Outputs

By default, outputs generated during the build are captured and displayed in Build Scans.

Note that when disabling test output capturing, test failures will still be captured.

<a id="capturing_build_and_test_outputs_when_disable"></a>

#### When to Disable

You may want to skip capturing build or test outputs for security/privacy reasons (i.e., some outputs may leak sensitive data), or performance/storage reasons (i.e., some tasks/tests may produce a lot of outputs that are irrelevant for your usage of Build Scans).

<a id="capturing_build_and_test_outputs_how_disable"></a>

#### How to Disable

Output capture can be enabled/disabled programmatically via the `buildScan` extension, or via a system property.

<a id="programmatically-2"></a>

##### Programmatically

To enable/disable programmatically, use the `buildScan` extension added by the Develocity Gradle plugin.

<a id="tabs-17"></a>

*   <a id="tabs-17-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-17-groovy"></a>
    
    Groovy
    

<a id="tabs-17-kotlin--panel"></a>

**Disabling build or test output logging:**

```
develocity {
    buildScan {
        capture {
            buildLogging.set(false)
            testLogging.set(false)
        }
    }
}
```

<a id="tabs-17-groovy--panel"></a>

**Disabling build or test output logging:**

```
develocity {
    buildScan {
        capture {
            buildLogging = false
            testLogging = false
        }
    }
}
```

See the [build logging API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanCaptureConfiguration.html#getBuildLogging\(\)) and the [test logging API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanCaptureConfiguration.html#getTestLogging\(\)).

<a id="via-system-property-2"></a>

##### Via System Property

To enable/disable without modifying the build script, supply the `scan.capture-build-logging` and/or `scan.capture-test-logging` system properties to the build. If the property is set to `false`, capture is disabled. Otherwise, capture is enabled. The environmental setting always takes precedence over the programmatic setting.

The system property may be specified when invoking the build:

```shell
./gradlew build -Dscan.capture-build-logging=false -Dscan.capture-test-logging=false
```

Or, can be set as part of the environment with the `JAVA_OPTS` or `GRADLE_OPTS` environment variables:

```shell
export GRADLE_OPTS="-Dscan.capture-build-logging=false -Dscan.capture-test-logging=false"
```

Or, can be set in the project’s `gradle.properties` file, or the user’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.scan.capture-build-logging=false
systemProp.scan.capture-test-logging=false
```

See the [Build Environment](https://docs.gradle.org/current/userguide/build_environment.html) chapter of the Gradle User Manual for more information on specifying system properties.

<a id="capturing-resource-usage"></a>

### Capturing Resource Usage

_(plugin 3.18+)_

Build Scans capture information on key resources of the machine executing the build. This includes CPU load, memory, disk usage, network activity, and the names of the most CPU-intensive processes. This data can help analyze poor build performance, whether due to the build needing too many resources or factors external to the build. It can also help understand if the machine is underutilized and if it could do more work.

By default, resource usage is captured and displayed in Build Scans.

> [!WARNING]
> Users of Gradle’s [configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html) feature must use version 7.6 of Gradle or later to benefit from resource usage capturing. When using plugin 3.18+ with earlier versions of Gradle and configuration caching turned on, resource usage capturing will be automatically disabled, and a warning message will be printed.

<a id="capturing-resource-usage-when-disable"></a>

#### When to Disable

You may want to skip capturing resource usage for security/privacy reasons. Note that the names of processes external to the build (i.e. not the build process nor its descendants) can be [obfuscated](#obfuscating_identifying_data).

<a id="capturing-resource-usage-how-disable"></a>

#### How to Disable

Resource usage capture can be enabled/disabled programmatically via the `buildScan` extension, or via a system property.

<a id="programmatically-3"></a>

##### Programmatically

To enable/disable programmatically, use the `buildScan` extension added by the Develocity Gradle plugin.

<a id="tabs-18"></a>

*   <a id="tabs-18-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-18-groovy"></a>
    
    Groovy
    

<a id="tabs-18-kotlin--panel"></a>

**Disabling resource usage capturing:**

```
develocity {
    buildScan {
        capture {
            resourceUsage.set(false)
        }
    }
}
```

<a id="tabs-18-groovy--panel"></a>

**Disabling resource usage capturing:**

```
develocity {
    buildScan {
        capture {
            resourceUsage = false
        }
    }
}
```

See the [resource usage API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanCaptureConfiguration.html#getResourceUsage\(\)).

<a id="via-system-property-3"></a>

##### Via System Property

To enable/disable without modifying the build script, supply the `scan.capture-resource-usage` system properties to the build. If the property is set to `false`, capture is disabled. Otherwise, capture is enabled. The environmental setting always takes precedence over the programmatic setting.

The system property may be specified when invoking the build:

```shell
./gradlew build -Dscan.capture-resource-usage=false
```

Or, can be set as part of the environment with the `JAVA_OPTS` or `GRADLE_OPTS` environment variables:

```shell
export GRADLE_OPTS="-Dscan.capture-resource-usage=false"
```

Or, can be set in the project’s `gradle.properties` file, or the user’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.scan.capture-resource-usage=false
```

See the [Build Environment](https://docs.gradle.org/current/userguide/build_environment.html) chapter of the Gradle User Manual for more information on specifying system properties.

<a id="extending_build_scans"></a>

### Extending Build Scans

You can easily include extra custom information in your Build Scans in the form of tags, links and values. This is a very powerful mechanism for capturing and sharing information that is important to your build and development process.

This information can be anything you like. You can tag all builds run by your continuous integration tool with a `CI` tag. You can capture the name of the environment that the build published to as a value. You can link to the source revision for the build in an online tool such as GitHub. The possibilities are endless.

You can see how the custom data appears in figures 1 and 2:

<a id="img-scan-with-custom-data-1"></a>

![A Build Scan Containing Tags and Links](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/scan-with-custom-data-1.png)

Example of a Build Scan Containing Tags and Links

<a id="img-scan-with-custom-data-2"></a>

![Example of a Build Scan Containing Custom Values](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/scan-with-custom-data-2.png)

Example of a Build Scan Containing Custom Values

Develocity allows listing and searching across all of the Build Scans in the system. You can find and filter Build Scans by tags and custom values, in addition to project name, outcome and other properties. In figure 3, for example, we are filtering for all Build Scans that have the tag "CI" and a git branch name of "master":

<a id="img-filtered-list-view"></a>

![A Filtered List of Build Scans in Develocity](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/build-scan-filtered-list.png)

Example of a Filtered List of Build Scans in Develocity

<a id="adding_tags"></a>

#### Adding Tags

Tags are typically used to indicate the type or class of a build, or a key characteristic. They are prominent in the user interface and quickly inform a user about the nature of a build. A build can have zero or more tags.

They can be added at build time via the `tag()` method:

<a id="tabs-19"></a>

*   <a id="tabs-19-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-19-groovy"></a>
    
    Groovy
    

<a id="tabs-19-kotlin--panel"></a>

**Adding tags to a build’s Build Scans:**

```
develocity {
    buildScan {
        tag(if (System.getenv("CI").isNullOrEmpty()) "Local" else "CI")
        tag(System.getProperty("os.name"))
    }
}
```

<a id="tabs-19-groovy--panel"></a>

**Adding tags to a build’s Build Scans:**

```
develocity {
    buildScan {
        if (System.getenv("CI")) {
            tag "CI"
        } else {
            tag "Local"
        }

        tag System.getProperty("os.name")
    }
}
```

As demonstrated by the example above, tags are typically applied either as fixed strings within a condition or evaluated at runtime from the environment. But there are no set rules that you need to follow—these are only suggestions.

The syntax for adding a tag is:

```
    tag(<tag>)
```

where the <tag> is a string.

Note that the order in which you declare the tags doesn’t affect the Build Scan view. They are displayed in alphabetical order, with any all-caps labels displayed before the rest.

> [!NOTE]
> The plugin imposes the following limits on captured tags: Maximum tag count: 50 Maximum tag length: 200 characters

<a id="adding-links"></a>

#### Adding Links

Builds rarely live in isolation. Where does the project source live? Is there online documentation for the project? Where can you find the project"s issue tracker? If these exist and have a URL, you can add them to the Build Scan.

They can be added at build time via the `link()` method:

<a id="tabs-20"></a>

*   <a id="tabs-20-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-20-groovy"></a>
    
    Groovy
    

<a id="tabs-20-kotlin--panel"></a>

**Adding a VCS URL to a build’s Build Scans:**

```
develocity {
    buildScan {
        link("VCS", "https://github.com/myorg/sample/tree/${System.getProperty("vcs.branch")}")
    }
}
```

<a id="tabs-20-groovy--panel"></a>

**Adding a VCS URL to a build’s Build Scans:**

```
develocity {
    buildScan {
        link "VCS", "https://github.com/myorg/sample/tree/${System.getProperty("vcs.branch")}"
    }
}
```

The above example demonstrates how you can attach a link to an online VCS repository that points to a specific branch provided as a system property.

The syntax for adding a link is:

```
    link(<label>, <URL>)
```

The <label> is simply a string identifier that you choose and that means something to you.

You can see the effect of a custom link in [figure 1](#img-scan-with-custom-data-1), which shows how a label _Source_ becomes a hyperlink that anyone viewing the Build Scan can follow.

> [!NOTE]
> The plugin imposes the following limits on captured links: Maximum link count: 20 Maximum link label length: 100 characters Maximum link URL length: 100,000 characters

<a id="adding_custom_values"></a>

#### Adding Custom Values

Some information just isn’t useful without context. What does "1G" mean? You might guess that it represents 1 gigabyte, but of what? It’s only when you attach the label "Max heap size for build" that it makes sense. The same applies to git commit IDs, for example, which could be interpreted as some other checksum without a suitable label.

Custom values are designed for these cases that require context. They’re standard key-value pairs, in which the key is a string label of your choosing and the values are also strings, often evaluated from the build environment.

They can be added at build time via the `value()` method:

<a id="tabs-21"></a>

*   <a id="tabs-21-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-21-groovy"></a>
    
    Groovy
    

<a id="tabs-21-kotlin--panel"></a>

**Adding custom values to a build’s Build Scans:**

```
develocity {
    buildScan {
        value("Build Number", project.buildNumber)
    }
}
```

<a id="tabs-21-groovy--panel"></a>

**Adding custom values to a build’s Build Scans:**

```
develocity {
    buildScan {
        value "Build Number", project.buildNumber
    }
}
```

The above example demonstrates how you can read the build number from a project property—assuming you have your build set up for this—and attach it to the Build Scans as a custom value.

The syntax for adding a value is:

```
    value(<key>, <value>)
```

where both the `<key>` and the `<value>` are strings.

As with tags, you can filter Build Scans by custom values in Develocity.

> [!NOTE]
> The plugin imposes the following limits on captured custom values: Maximum custom value count: 1,000 Maximum custom value key length: 1,000 characters Maximum custom value value length: 100,000 characters

<a id="adding-data-at-the-end-of-the-build"></a>

#### Adding Data at the End of the Build

The examples you have seen so far work well if when the custom data is available at the beginning of the build. But what if you want to attach data that’s only available later? For example, you might want to label a build as "built-from-clean" if the `clean` task was run. But you don’t know if that’s the case until the task execution graph is ready.

The Develocity Gradle plugin provides a `buildFinished()` hook that you can use for these situations. It defers attaching custom data until the build has finished running. As an example, imagine you want to report how much disk space was taken up by the output `build` directory. The build doesn’t know this until it’s finished, so the solution is to calculate the disk space and attach it to a custom value in the `buildFinished()` hook:

<a id="tabs-22"></a>

*   <a id="tabs-22-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-22-groovy"></a>
    
    Groovy
    

<a id="tabs-22-kotlin--panel"></a>

**Adding a custom disk usage value at the end of the build:**

```
develocity {
    buildScan {
        buildFinished {
            value("Disk usage (output dir)", buildDir.walkTopDown().map { it.length() }.sum().toString())
        }
    }
}
```

<a id="tabs-22-groovy--panel"></a>

**Adding a custom disk usage value at the end of the build:**

```
develocity {
    buildScan {
        buildFinished {
            value "Disk usage (output dir)", buildDir.directorySize().toString()
        }
    }
}
```

The `buildFinished()` action has access to the rest of the build, including the `Project` instance, so it can extract all sorts of information. It also has access to a `BuildResult` instance that you can use to determine whether the build failed or not, like so:

<a id="tabs-23"></a>

*   <a id="tabs-23-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-23-groovy"></a>
    
    Groovy
    

<a id="tabs-23-kotlin--panel"></a>

**Checking build status from buildFinished():**

```
develocity {
    buildScan {
        buildFinished {
            if (this.failures.isNotEmpty()) {
                value("Failed with", this.failures.joinToString(", ") { it.message })
            }
        }
    }
}
```

<a id="tabs-23-groovy--panel"></a>

**Checking build status from buildFinished():**

```
import com.gradle.scan.plugin.BuildResult

develocity {
    buildScan {
        buildFinished { BuildResult result ->
            if (result.failures) {
                value "Failed with", result.failures.message.join(", ")
            }
        }
    }
}
```

> [!NOTE]
> The Gradle build tool has a BuildListener interface that also contains a buildFinished() hook. However, you cannot use this to attach custom data because it is triggered too late. You can use hooks like project.afterEvaluate() or the buildStarted() method of BuildListener because they are executed early enough.

<a id="adding-expensive-data"></a>

#### Adding Expensive Data

Some data that you may want to add to your Build Scan can be expensive to capture. For example, capturing the Git commit ID may require executing the `git` command as an external process, which is expensive. To do this without slowing your build down, you can use the `buildScan.background()` method:

<a id="tabs-24"></a>

*   <a id="tabs-24-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-24-groovy"></a>
    
    Groovy
    

<a id="tabs-24-kotlin--panel"></a>

**Using background() to capture an expensive custom value with Gradle 6.2+ and Configuration Cache compatibility.:**

```
import org.gradle.kotlin.dsl.support.serviceOf
import java.io.ByteArrayOutputStream
...

develocity {
  buildScan {
    val execOps = serviceOf<ExecOperations>()
    background {
      val os = ByteArrayOutputStream()
      execOps.exec {
        commandLine("git", "rev-parse", "--verify", "HEAD")
        standardOutput = os
      }
      value("Git Commit ID", os.toString())
    }
  }
}
```

**Using background() to capture an expensive custom value with Gradle 5.x:**

```
import java.io.ByteArrayOutputStream
...
develocity {
    buildScan {
        background {
            val os = ByteArrayOutputStream()
            exec {
                commandLine("git", "rev-parse", "--verify", "HEAD")
                standardOutput = os
            }
            value("Git Commit ID", os.toString())
        }
    }
}
```

<a id="tabs-24-groovy--panel"></a>

**Using background() to capture an expensive custom value:**

```
develocity {
    buildScan {
        background {
            def commitId = "git rev-parse --verify HEAD".execute().text.trim()
            value "Git Commit ID", commitId
        }
    }
}
```

This method takes a function that will be executed on a separate thread, which allows Gradle to continue without waiting for the expensive work to complete.

All background work will be completed before finishing the build and publishing the Build Scan.

Any errors that are thrown by the background action will be logged and captured in the Build Scan.

See the [buildScan.background() API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanConfiguration.html#background\(org.gradle.api.Action\)) for more information.

<a id="providing-custom-data-via-system-properties"></a>

#### Providing Custom Data via System Properties

The examples up to this point have shown how your build file or init script can _pull_ information from the environment, via environment variables and system properties. The Develocity Gradle plugin also allows you to _inject_ any form of custom data through the use of specially named system properties. This can help you keep your build files clean of too much environment-specific information that may not be relevant to most of the users of the build.

These system properties take the following forms, depending on whether you want to inject a link, a tag or a custom value:

```
    -Dscan.tag.<tag>
    -Dscan.link.<label>=<URL>
    -Dscan.value.<key>=<value>
```

Here are some concrete examples, which assume that the build has been configured to publish Build Scans automatically:

```shell
./gradlew build -Dscan.tag.CI
```

```shell
./gradlew build -Dscan.link.VCS=https://github.com/myorg/my-super-project/tree/my-new-feature
```

```shell
./gradlew build "-Dscan.value.CIBuildType=QA_Build"
```

This feature is particularly useful for continuous integration builds as you can typically easily configure your CI tool to specify system properties for a build. It’s even common for CI tools to be able to inject system properties into a build that are interpolated with information from the CI system, such as build number.

```shell
./gradlew build "-Dscan.value.buildNumber=$CI_BUILD_NUMBER"
```

<a id="capturing-the-build-scan-id-or-address"></a>

### Capturing the Build Scan ID or Address

The address of the Build Scan is included in the output at the end of the build. However, you may want to record the ID or URL of the Build Scan in some other way. The Develocity Gradle plugin allows you to register a callback that will receive this information. The callback is invoked after a Build Scan has been successfully published.

The example build script snippet below shows this feature being used to maintain a journal of created Build Scans.

> [!NOTE]
> Develocity provides the ability to search for Build Scans created by a certain user and/or from a particular host (along with other search criteria).

<a id="tabs-25"></a>

*   <a id="tabs-25-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-25-groovy"></a>
    
    Groovy
    

<a id="tabs-25-kotlin--panel"></a>

**Creating a log of published Build Scans:**

```
import java.util.Date

develocity {
    buildScan {
        buildScanPublished {
            file("scan-journal.log").appendText("${Date()} - ${this.buildScanId} - ${this.buildScanUri}\n")
        }
    }
}
```

<a id="tabs-25-groovy--panel"></a>

**Creating a log of published Build Scans:**

```
import com.gradle.scan.plugin.PublishedBuildScan

develocity {
    buildScan {
        buildScanPublished { PublishedBuildScan scan ->
            file("scan-journal.log") << "${new Date()} - ${scan.buildScanId} - ${scan.buildScanUri}\n"
        }
    }
}
```

See the [buildScan.buildScanPublished()](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanConfiguration.html#buildScanPublished\(org.gradle.api.Action\)) method for API details.

<a id="obfuscating_identifying_data"></a>

### Obfuscating Identifying Data

Build Scans capture certain identifying information such as the operating system username, hostname, network addresses, and CPU-intensive process names. You may choose to obfuscate this data so that it is not decipherable in Build Scans when viewed, by registering obfuscation functions as part of the [Build Scan configuration](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/scan/BuildScanConfiguration.html#buildScanPublished\(org.gradle.api.Action\)).

The following examples show registering obfuscation functions for the different identifying data.

<a id="tabs-26"></a>

*   <a id="tabs-26-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-26-groovy"></a>
    
    Groovy
    

<a id="tabs-26-kotlin--panel"></a>

**Obfuscating the username:**

```
develocity {
    buildScan {
        obfuscation {
            username { name -> name.reversed() }
        }
    }
}
```

<a id="tabs-26-groovy--panel"></a>

**Obfuscating the username:**

```
develocity {
    buildScan {
        obfuscation {
            username { name -> name.reverse() }
        }
    }
}
```

<a id="tabs-27"></a>

*   <a id="tabs-27-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-27-groovy"></a>
    
    Groovy
    

<a id="tabs-27-kotlin--panel"></a>

**Obfuscating the hostnames:**

```
develocity {
    buildScan {
        obfuscation {
            hostname { host -> host.toCharArray().map { character -> Character.getNumericValue(character) }.joinToString("-") }
        }
    }
}
```

<a id="tabs-27-groovy--panel"></a>

**Obfuscating the hostnames:**

```
develocity {
    buildScan {
        obfuscation {
            hostname { host -> host.collect { character -> Character.getNumericValue(character as char) }.join("-") }
        }
    }
}
```

<a id="tabs-28"></a>

*   <a id="tabs-28-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-28-groovy"></a>
    
    Groovy
    

<a id="tabs-28-kotlin--panel"></a>

**Obfuscating the IP addresses:**

```
develocity {
    buildScan {
        obfuscation {
            ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
        }
    }
}
```

<a id="tabs-28-groovy--panel"></a>

**Obfuscating the IP addresses:**

```
develocity {
    buildScan {
        obfuscation {
            ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0" } }
        }
    }
}
```

<a id="tabs-29"></a>

*   <a id="tabs-29-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-29-groovy"></a>
    
    Groovy
    

<a id="tabs-29-kotlin--panel"></a>

**Obfuscating the non-build-related process names (plugin 3.18+):**

```
develocity {
    buildScan {
        obfuscation {
            externalProcessName { processName -> "non-build-process" }
        }
    }
}
```

<a id="tabs-29-groovy--panel"></a>

**Obfuscating the non-build-related process names (plugin 3.18+):**

```
develocity {
    buildScan {
        obfuscation {
            externalProcessName { processName -> 'non-build-process' }
        }
    }
}
```

<a id="ci_tool"></a>

### Integrating Your CI Tool

<a id="jenkins"></a>

#### Jenkins

The [Gradle Jenkins plugin](https://plugins.jenkins.io/gradle) prominently displays links to the Build Scan for any Gradle or Maven build that produce Build Scans, which makes it convenient to access the Build Scans. See the following screenshot for an example:

![.Gradle Jenkins Plugin](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/ci-tools/jenkins.png)

Gradle Jenkins Plugin

Besides that, the plugin allows you to instrument all CI jobs and to publish a Build Scan without modifying the underlying projects. This eases the adoption of Build Scans within the company and allows configuring the Develocity Gradle plugin or Develocity Maven extension in a central place. For more information read the documentation [here](https://github.com/jenkinsci/gradle-plugin#develocity-integration).

<a id="teamcity"></a>

#### TeamCity

The [Develocity integration plugin](https://plugins.jetbrains.com/plugin/27005-develocity-integration) prominently displays links to the Build Scan for any Gradle or Maven build that produce Build Scans, which makes it convenient to access the Build Scans. See the following screenshot for an example:

![Develocity Build Scan Integration for TeamCity](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/ci-tools/teamcity.png)

Develocity Build Scan Integration for TeamCity

Besides that, the plugin allows you to instrument all CI jobs and to publish a Build Scan without modifying the underlying projects. This eases the adoption of Build Scans within the company and allows configuring the Develocity Gradle plugin or Develocity Maven extension in a central place.

<a id="bamboo"></a>

#### Bamboo

The [Develocity Bamboo plugin](https://marketplace.atlassian.com/apps/1230500/develocity-plugin-for-bamboo) prominently displays links to the Build Scan for any Gradle or Maven build that produce Build Scans, which makes it convenient to access the Build Scans. See the following screenshot for an example:

![.Develocity Bamboo Plugin](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/ci-tools/bamboo.png)

Develocity Bamboo Plugin

Besides that, the plugin allows you to instrument all CI jobs and to publish a Build Scan without modifying the underlying projects. This eases the adoption of Build Scans within the company and allows configuring the Develocity Gradle plugin or Develocity Maven extension in a central place. For more information read the documentation [here](https://github.com/gradle/gradle-enterprise-bamboo-plugin#gradle-auto-instrumentation).

<a id="gitlab-templates"></a>

#### GitLab Templates

The [Develocity GitLab templates](https://github.com/gradle/develocity-gitlab-templates) allow you to instrument CI jobs and to publish a Build Scan without modifying the project’s build scripts. This eases the adoption of Build Scans within the company and allows configuring the Develocity Gradle plugin or Develocity Maven extension at the CI level. For more information read the documentation [here](https://github.com/gradle/develocity-gitlab-templates).

<a id="github-actions"></a>

#### GitHub Actions

The [Gradle GitHub Action](https://github.com/marketplace/actions/build-with-gradle) prominently displays links to Build Scan data for any Gradle build that produces it, making the data easily accessible.

The action allows you to instrument all CI jobs and publish a Build Scan without modifying the underlying Gradle build, using environment variables defined in your GitHub Actions workflow. You can configure the Develocity Gradle plugin at the CI level using environment variables in your GitHub Actions workflow.

See the following screenshot for an example:

![Gradle GitHub Action](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/ci-tools/githubactions.png)

Gradle GitHub Action

For more information, see the [Gradle GitHub Action documentation](https://github.com/marketplace/actions/build-with-gradle).

<a id="ide_integration"></a>

### Integration With IntelliJ IDEs

The [Develocity IntelliJ plugin](https://docs.gradle.com/develocity/intellij-plugin/1.3/) seamlessly integrates Develocity and Build Scan capabilities directly into your IDE. It displays a live timeline of task execution and resource usage within your IntelliJ IDE.

![Live Build Timeline](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../../../intellij-plugin/1.3/_images/intellij-timeline-gradle.gif)

Live Build Timeline

Moreover, it provides a streamlined Develocity configuration for local builds by allowing you to apply and configure the Develocity Gradle plugin to your projects, simplifying the adoption of build performance optimization and troubleshooting.

![Streamlined Develocity Configuration](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../../../intellij-plugin/1.3/_images/intellij-develocity-configuration.png)

Streamlined Develocity Configuration

<a id="viewing_test_results"></a>

## Viewing Test Results

The Develocity plugin will capture test execution results and publish them to the Develocity server. After your Build Scan® is ready, you can view and analyze the results.

Any test framework that is supported by Gradle’s _Test_ task and based on JUnit Platform should work with Develocity without requiring any change. Contact us at [support.gradle.com](https://support.gradle.com) if the results are not correctly displayed for the test framework that you are using.

<a id="the-test-overview-page"></a>

### The Test Overview Page

The Test overview page shows a high level overview of all the tests that were executed as part of the build. The test results are displayed hierarchically: they are grouped by _task_, _test suite_ and finally _test case_. Next to each _task_, _test suite_ and _test case_, the outcome and the total time are displayed.

![Example of the Tests Overview Page](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/test-overview.png)

Example of the Tests Overview Page

<a id="test-outcomes"></a>

#### Test Outcomes

Every _task_, _test suite_ and _test case_ has an outcome. For a _task_, the outcome is either `SUCCESS`, indicating that the _task_ was successful, `FLAKY`, which means that at least one _test suite_ was flaky, or `FAILED`, if a test suite has failed.

For _test suites_, the outcome can be `SUCCESS`, meaning that all executed _test cases_ were successful, `FAILED`, indicating that at least one _test case_ failed, `FLAKY`, meaning that at least one _test case_ was successful only after retry, or `SKIPPED`, meaning that the _test suite_ was not executed.

For _test cases_, the outcome can be `SKIPPED`, meaning that the _test case_ was not executed, `SUCCESS`, meaning that the _test case_ was successful, `FAILED` indicating that the _test case_ was failed, or `FLAKY`, meaning that the test case was successful only after retry.

<a id="test-timings"></a>

#### Test Timings

On a _task_, the _total time_ corresponds to the total amount of wall clock time the task took to execute.

On a test suite, the _total time_ corresponds to the total amount of wall clock time the test suite took to execute.

On a test case, the _total time_ corresponds to the total amount of wall clock time the test case took to execute. Clicking on a _test task_ will open the details for this _test task_, which will display the results of the _test suites_ which ran as part of this _test task_.

<a id="test-task-details-page"></a>

### Test Task Details Page

The Test task details page displays the results of the _test suites_ which ran as part of the selected _test task_.

![Example of the Tests Task Details Page](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/test-task-details.png)

Example of the Tests Task Details Page

At the top of the page, it also shows relevant configuration values, and performance statistics. Clicking on a _test suite_ will open the details for this _test suite_, which will display the results of the _test cases_ which ran as part of this _test suite_.

<a id="test-suite-details-page"></a>

### Test Suite Details Page

The Test suite details page displays the results of the _test cases_ which ran as part of the selected _test suite_.

![Example of the Tests Suite Details](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/test-suite-details.png)

Example of the Tests Suite Details

Errors that may have happened during the setup or cleanup phase of the _test suite_ execution are reported in this page.

The suite’s overall outcome is broken down into _Class setup/cleanup_ and _Test execution_ outcomes. _Class setup/cleanup_ tracks whether a failure occurred in the suite’s setup / teardown callbacks, and _Test execution_ whether it was a _test case_ that caused the _test suite_ to fail.

At the bottom of the page, the _test cases_ that were executed as part of this _test suite_ are listed, along with the time and outcome of each execution. A _test case_ may be run more than once in case of retries.

Clicking on a _test case_ will open the details for this _test case_, which will display the results of the executions of this _test case_.

<a id="test-case-details-page"></a>

### Test Case Details Page

The Test case details page displays the results of the executions of the selected _test case_.

![Example of the Tests Details Page](https://docs.gradle.com/develocity/gradle/4.3/gradle-plugin/../_images/test-case-details.png)

Example of the Tests Details Page

The total time and outcome of each execution of the selected _test case_ are displayed on the page. If an execution failed with an exception, then the exception is displayed under the corresponding execution.

<a id="using_build_caching"></a>

## Using Build Caching

The Develocity Gradle plugin provides a Build Cache connector that can be used to leverage the Build Cache provided by Develocity. Gradle’s [out-of-the-box support for generic HTTP Build Cache servers](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_configure_remote) is also compatible with the Build Cache provided by Develocity, and can be used when the Develocity specific connector can not be used.

The Develocity specific connector should be preferred, and can be used whenever all of the following conditions are met:

*   You are using Gradle version >= 6.0
    
*   You are using Develocity Build Cache Nodes of version >= 13
    

<a id="using_the_develocity_connector"></a>

### Using the Develocity Connector

_(Gradle 6+)_

> [!WARNING]
> Users of Gradle’s [configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html) feature must use version 7.5.1 of Gradle or later when using the Develocity Build Cache connector. Earlier versions of Gradle will fail with an error message stating “Could not create service of type BuildCacheController”.

The Develocity Build Cache connector can be used by registering the connector with Gradle and configuring it:

<a id="tabs-30"></a>

*   <a id="tabs-30-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-30-groovy"></a>
    
    Groovy
    

<a id="tabs-30-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(develocity.buildCache) {
        // configure
    }
}
```

<a id="tabs-30-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(develocity.buildCache) {
        // configure
    }
}
```

The `buildCache {}` method is [provided by Gradle](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_configure), with the `develocity.buildCache` method being provided by the [Develocity configuration](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/DevelocityConfiguration.html#getBuildCache\(\)).

Without further configuration, the build will now attempt to read entries from the built-in Build Cache of the specified Develocity server. The [connector of type DevelocityBuildCache](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/buildcache/DevelocityBuildCache.html) can be configured inside the configuration block.

<a id="credentials"></a>

#### Credentials

If an access key has been configured for the specified Develocity server (see [Authenticating](#authenticating)), it will be used. Otherwise, requests will be sent anonymously.

Develocity also allows build caches to be configured with username and password credentials separate to access-key-based access control. To connect with a username and password credential, use the [usernameAndPassword()](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/buildcache/DevelocityBuildCache.html#usernameAndPassword\(java.lang.String,java.lang.String\)) method. The username and password will be used _instead of_ any configured access key.

<a id="tabs-31"></a>

*   <a id="tabs-31-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-31-groovy"></a>
    
    Groovy
    

<a id="tabs-31-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(develocity.buildCache) {
        usernameAndPassword("user", "pass")
    }
}
```

<a id="tabs-31-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(develocity.buildCache) {
        usernameAndPassword("user", "pass")
    }
}
```

<a id="writing-to-the-build-cache"></a>

#### Writing to the Build Cache

By default, Gradle will only attempt to read from the Build Cache. To also write to the Build Cache, the `push` property of the connector must be configured to `true`.

<a id="tabs-32"></a>

*   <a id="tabs-32-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-32-groovy"></a>
    
    Groovy
    

<a id="tabs-32-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(develocity.buildCache) {
        isPush = true
    }
}
```

<a id="tabs-32-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(develocity.buildCache) {
        push = true
    }
}
```

The write attempt may be rejected due to insufficient permissions depending on the Develocity server’s access control settings.

<a id="using-expect-continue"></a>

#### Using Expect-Continue

The Develocity Build Cache client allows opt-in use of [HTTP Expect-Continue](https://www.rfc-editor.org/rfc/rfc9110.html#section-10.1.1). This causes PUT requests to happen in two parts: first a check whether a body would be accepted, then transmission of the body if the server indicates it will accept it. This is particularly suitable for Build Cache servers that routinely redirect or reject PUT requests, as it avoids transmitting the cache entry just to have it rejected (for example, the cache entry is larger than the Build Cache will allow). This additional check incurs extra latency when the server accepts the request, but reduces latency when the request is rejected or redirected.

While the Develocity Build Cache node supports Expect-Continue, not all HTTP servers and proxies reliably do. Be sure to check that your Build Cache server does support it before enabling.

<a id="tabs-33"></a>

*   <a id="tabs-33-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-33-groovy"></a>
    
    Groovy
    

<a id="tabs-33-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(develocity.buildCache) {
        useExpectContinue = true
    }
}
```

<a id="tabs-33-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(develocity.buildCache) {
        useExpectContinue = true
    }
}
```

<a id="using-a-non-built-in-cache"></a>

#### Using a Non-Built-In Cache

Develocity provides a built-in Build Cache, but can also leverage separately deployed [Build Cache nodes](https://docs.gradle.com/develocity/bcn/21.2/) for geographical distribution and horizontal scaling. If you are using such a non-built-in node, you must configure its address with the Build Cache connector.

<a id="tabs-34"></a>

*   <a id="tabs-34-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-34-groovy"></a>
    
    Groovy
    

<a id="tabs-34-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(develocity.buildCache) {
        server = "https://develocity-cache-1.example.com"
    }
}
```

<a id="tabs-34-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(develocity.buildCache) {
        server = "https://develocity-cache-1.example.com"
    }
}
```

Note that the server address should be specified without any request path component.

If using access-key-based authentication, the given Build Cache server must be of version 13 or later and be connected with the Develocity server specified by the `develocity {}` extension.

> [!NOTE]
> Similar to the Develocity server configuration, the remote Build Cache server configuration also provides an allowUntrustedServer option to circumvent certificate warnings: Kotlin Groovy

> [!WARNING]
> This is a convenient workaround during the initial evaluation, but it is a serious security issue and should not be used in production.

<a id="using-gradles-built-in-http-connector"></a>

### Using Gradle’s Built-In HTTP Connector

Gradle’s [out-of-the-box support for generic HTTP Build Cache servers](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_configure_remote) is also compatible with the Build Cache provided by Develocity, and can be used when the Develocity specific connector can not be used.

<a id="tabs-36"></a>

*   <a id="tabs-36-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-36-groovy"></a>
    
    Groovy
    

<a id="tabs-36-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
}

buildCache {
    remote(HttpBuildCache::class) {
        url = uri("https://develocity.example.com/cache/")
    }
}
```

<a id="tabs-36-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
}

buildCache {
    remote(HttpBuildCache) {
        url = 'https://develocity.example.com/cache/'
    }
}
```

When using this connector, [username and password based access control](https://docs.gradle.org/current/userguide/build_cache.html#specifying_access_credentials) is expected but is only supported by the Develocity Build Cache through version 2024.2. See the Develocity Administration Manual for details on [utilizing an access key with the HTTP connector](https://docs.gradle.com/develocity/2026.1/operations/migrations/build-cache-access-control-migration/#built_in_http_connector).

<a id="predictive_test_selection"></a>

## Using Predictive Test Selection

Develocity Predictive Test Selection allows developers to get faster feedback by running only tests that are likely to provide useful feedback on a particular code change using a probabilistic machine learning model.

> [!TIP]
> For information on how to use Predictive Test Selection, consult the [Predictive Test Selection User Manual](https://docs.gradle.com/develocity/2026.1/using-develocity/predictive-test-selection/).

<a id="test_distribution"></a>

## Using Test Distribution

Develocity Test Distribution takes your existing test suites and distributes them across remote agents to execute them faster.

> [!TIP]
> For information on how to use Test Distribution, consult the [Test Distribution User Manual](https://docs.gradle.com/develocity/test-distribution/3.7/).

<a id="test_retry"></a>

## Using Test Retry

When test retry is enabled, any failed tests are retried after all the tests have been executed. The process repeats with tests that continue to fail until the maximum specified number of retries has been attempted, or there are no more failing tests.

By default, the test task does not fail when all failed tests pass after a retry. This setting can be changed so that tests that pass on retry cause the task to fail.

Tests that initially fail but pass on retry are considered “flaky” by Develocity. For information on how to detect flaky tests with test retry, consult the [Develocity Flaky Test Detection Guide](https://docs.gradle.com/develocity/2026.1/guides/flaky-test-detection-guide/).

<a id="configuration"></a>

### Configuration

Test retry is not enabled by default. It can be enabled and configured via the `retry` extension added to each `Test` task by the plugin.

<a id="tabs-37"></a>

*   <a id="tabs-37-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-37-groovy"></a>
    
    Groovy
    

<a id="tabs-37-kotlin--panel"></a>

**build.gradle.kts:**

```
tasks.test {
    develocity.testRetry {
        maxRetries.set(3) (1)
        maxFailures.set(20) (2)
        failOnPassedAfterRetry.set(true)(3)
    }
}
```

<a id="tabs-37-groovy--panel"></a>

**build.gradle:**

```
tasks.named('test', Test) {
    develocity.testRetry {
        maxRetries = 3  (1)
        maxFailures = 20  (2)
        failOnPassedAfterRetry = true  (3)
    }
}
```

1. The maximum number of times to retry an individual test.
2. The maximum number of test failures allowed before retrying is disabled for the current test run.
3. Whether tests that initially fail and then pass on retry should fail the task.

See the [retry configuration API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/com/gradle/develocity/agent/gradle/test/TestRetryConfiguration.html).

<a id="retrying-only-some-tests"></a>

#### Retrying Only Some Tests

By default, all tests are eligible for retrying. The `filter` component of the test retry extension can be used to control which tests should be retried and which should not.

The decision to retry a test or not is based on the tests reported class name, regardless of the name of the test case or method. The annotations present or not on this class can also be used as the criteria.

<a id="tabs-38"></a>

*   <a id="tabs-38-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-38-groovy"></a>
    
    Groovy
    

<a id="tabs-38-kotlin--panel"></a>

**build.gradle.kts:**

```
tasks.test {
    develocity.testRetry {
        maxRetries.set(3)
        filter {
            // filter by qualified class name (* matches zero or more of any character)
            includeClasses.add("*IntegrationTest")
            excludeClasses.add("*DatabaseTest")

            // filter by class level annotations
            // Note: @Inherited annotations are respected
            includeAnnotationClasses.add("*Retryable")
            excludeAnnotationClasses.add("*NonRetryable")
        }
    }
}
```

<a id="tabs-38-groovy--panel"></a>

**build.gradle:**

```
tasks.named('test', Test) {
    develocity.testRetry {
        maxRetries = 3
        filter {
            // filter by qualified class name (* matches zero or more of any character)
            includeClasses.add("*IntegrationTest")
            excludeClasses.add("*DatabaseTest")

            // filter by class level annotations
            // Note: @Inherited annotations are respected
            includeAnnotationClasses.add("*Retryable")
            excludeAnnotationClasses.add("*NonRetryable")
        }
    }
}
```

<a id="retrying-on-class-level"></a>

#### Retrying on Class-Level

By default, individual tests are retried. The `classRetry` component of the test retry extension can be used to control which test classes must be retried as a whole unit. To retry a class as a whole, the class must also satisfy the configured filter.

<a id="tabs-39"></a>

*   <a id="tabs-39-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-39-groovy"></a>
    
    Groovy
    

<a id="tabs-39-kotlin--panel"></a>

**build.gradle.kts:**

```
tasks.test {
    develocity.testRetry {
        maxRetries.set(3)
        classRetry {
            // configure by qualified class name (* matches zero or more of any character)
            includeClasses.add("*StepWiseIntegrationTest")

            // configure by class level annotations
            // Note: @Inherited annotations are respected
            includeAnnotationClasses.add("*ClassRetry")
        }
    }
}
```

<a id="tabs-39-groovy--panel"></a>

**build.gradle:**

```
tasks.named('test', Test) {
    develocity.testRetry {
        maxRetries.set(3)
        classRetry {
            // configure by qualified class name (* matches zero or more of any character)
            includeClasses.add("*StepWiseIntegrationTest")

            // configure by class level annotations
            // Note: @Inherited annotations are respected
            includeAnnotationClasses.add("*ClassRetry")
        }
    }
}
```

> [!TIP]
> You can also use the `ClassRetry` annotation from the [develocity-testing-annotations project](https://github.com/gradle/develocity-testing-annotations) without any additional configuration other than the dependency.

<a id="retrying-only-for-ci-builds"></a>

### Retrying Only for CI Builds

You may find that local developer builds do not benefit much from retry behavior, particularly when those tests are invoked via your IDE. In that case we recommend enabling retry only for CI builds.

<a id="tabs-40"></a>

*   <a id="tabs-40-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-40-groovy"></a>
    
    Groovy
    

<a id="tabs-40-kotlin--panel"></a>

**build.gradle.kts:**

```
val isCiServer = System.getenv().containsKey("CI")
tasks.test {
    develocity.testRetry {
        if (isCiServer) { (1)
            maxRetries.set(3)
            maxFailures.set(20)
            failOnPassedAfterRetry.set(true)
        }
    }
}
```

<a id="tabs-40-groovy--panel"></a>

**build.gradle:**

```
boolean isCiServer = System.getenv().containsKey("CI")
tasks.named('test', Test) {
    develocity.testRetry {
        if (isCiServer) {
            maxRetries = 3
            maxFailures = 20
            failOnPassedAfterRetry = true
        }
    }
}
```

1. Only configure retrying tests, when running on CI

<a id="test_retry_migration"></a>

### Migrating From Test Retry Gradle Plugin

Prior to version 3.12 of this plugin, enabling test retries required the `org.gradle.test-retry` plugin. It is recommended that Develocity users adopt the Develocity plugin’s retry functionality for ensured future compatibility and easier adoption of future Develocity specific features.

This plugin offers effectively the same API as the `org.gradle.test-retry` plugin, making migrating simple:

*   Builds using Groovy build scripts need to just remove reference to the `org.gradle.test-retry` plugin.
    
*   Builds using Kotlin DSL build scripts need to remove reference to the `org.gradle.test-retry` plugin _and_ add an import of `com.gradle.enterprise.gradleplugin.testretry.retry`.
    

If you cannot easily remove the `org.gradle.test-retry` plugin from your build, you can disable the test retry functionality provided by the Gradle Enterprise Gradle plugin by setting the system property `develocity.testretry.enabled` to `false`.

The system property can be specified in the user’s or build’s `gradle.properties` file (i.e. `~/.gradle/gradle.properties`).

```properties
systemProp.develocity.testretry.enabled=false
```

See the [Build Environment](https://docs.gradle.org/current/userguide/build_environment.html) chapter of the Gradle User Manual for more information on specifying system properties.

<a id="upgrading-to-gradle-6"></a>

## Upgrading to Gradle 6

Starting with Gradle 6, the Develocity plugin needs to be applied to the settings file of the build rather than the root project.

To upgrade, first locate where the plugin is being applied and remove it. This is likely to be in the root `build.gradle` or `build.gradle.kts` file, and will look similar to the following:

<a id="tabs-41"></a>

*   <a id="tabs-41-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-41-groovy"></a>
    
    Groovy
    

<a id="tabs-41-kotlin--panel"></a>

**build.gradle.kts:**

```
plugins {
    id("com.gradle.develocity").version("4.3.2")
}
```

<a id="tabs-41-groovy--panel"></a>

**build.gradle:**

```
plugins {
    id "com.gradle.develocity" version "4.3.2"
}
```

Then, add the following to the `settings.gradle` or `settings.gradle.kts` file for the build:

<a id="tabs-42"></a>

*   <a id="tabs-42-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-42-groovy"></a>
    
    Groovy
    

<a id="tabs-42-kotlin--panel"></a>

**settings.gradle.kts:**

```
plugins {
    id("com.gradle.develocity") version("4.3.2")
}
```

<a id="tabs-42-groovy--panel"></a>

**settings.gradle:**

```
plugins {
    id "com.gradle.develocity" version "4.3.2"
}
```

Any `buildScan {}` configuration should be enclosed in a `develocity {}` block, or be moved to the settings file inside a `develocity {}` block. Please see the [Gradle 6.x section](#gradle_6_x_and_later) above for more information.

<a id="tabs-43"></a>

*   <a id="tabs-43-kotlin"></a>
    
    Kotlin
    
*   <a id="tabs-43-groovy"></a>
    
    Groovy
    

<a id="tabs-43-kotlin--panel"></a>

**settings.gradle.kts:**

```
develocity {
    server.set("https://develocity.example.com")
    buildScan {
        // tags and other settings
    }
}
```

<a id="tabs-43-groovy--panel"></a>

**settings.gradle:**

```
develocity {
    server = "https://develocity.example.com"
    buildScan {
        // tags and other settings
    }
}
```

<a id="older_gradle"></a>

## Gradle 4.x and Earlier

Gradle versions earlier than 5.0 are not compatible with the Develocity Gradle plugin. Refer to the [(Legacy) Gradle Enterprise Gradle Plugin User Manual](https://docs.gradle.com/develocity/legacy/gradle-plugin/legacy/#older-gradle) for information on using the “Build Scan” plugin with Gradle 4.x and earlier.

<a id="troubleshooting"></a>

## Troubleshooting

<a id="failed-background-build-scan-uploads"></a>

### Failed Background Build Scan Uploads

When using background Build Scan uploading (default behavior, see [this section](#configuring_background_uploading) for configuration options) upload failures are not visible in the build logging due to occurring in a background process after the build has finished. Instead, errors are logged to a file located at `~/.gradle/build-scan-data/upload-failure.log`. If this additional information does not help to resolve the failure, please contact the technical support and include the contents of this log file.

If the background upload process fails to start, a warning is shown in the build console and uploading is performed in the build process. If this occurs, please the contact technical support with the log files located at `~/.gradle/build-scan-data/<<plugin-version>>/pending-uploads/*.log`.

<a id="slow-resolution-of-host-name"></a>

### Slow Resolution of Host Name

Build Scans attempt to determine the hostname of the machine. An [issue affecting macOS](https://bugs.openjdk.org/browse/JDK-7180557) can cause a delay when doing this in some environments.

If you see a warning during your build that resolving the local hostname is slow, you can workaround the problem by adding a hostname mapping to your `/etc/hosts` file.

Add these lines to your `/etc/hosts` file, substituting your computer name for 'mbpro' in the below snippet:

```
./etc/hosts
127.0.0.1   localhost mbpro.local
::1         localhost mbpro.local
```

* * *

If you have any questions or need any assistance contact the Develocity support team or your customer success representative.

<a id="api-reference"></a>

## Appendix A: API Reference

See the [API reference](https://docs.gradle.com/downloads/gradle-plugin-javadoc/4.3.2/) for more details about programmatic configuration of the Develocity Gradle plugin.

The [Common Custom User Data Gradle Plugin](https://github.com/gradle/common-custom-user-data-gradle-plugin) provided by Gradle Inc. provides an example. This plugin can be applied directly to your project, or can serve as a template project for your own plugin implementation.

<a id="captured-information"></a>

## Appendix B: Captured Information

The Develocity Gradle plugin captures information while the build is running and transmits it to a server after the build has completed.

Most of the information captured can be considered to be build data. This includes the name of the projects in your build, the tasks, plugins, dependencies, names and results of tests and other things of this nature. Some more general environmental information is also captured. This includes your Java version, operating system, hardware, country, timezone and other things of this nature.

Notably, the actual source code being built and the output artifacts are _not_ captured. However, error messages emitted by compilers or errors in tests may reveal aspects of the source code.

<a id="listing"></a>

### Listing

The list below details the notable information captured by the Develocity Gradle plugin and transmitted in a Build Scan.

*   Environment
    
    *   User home (system property `'user.home'`)
        
    *   Username (system property `'user.name'`) (Can be [obfuscated](#obfuscating_identifying_data))
        
    *   Local hostname (environment variable `'COMPUTERNAME'` / `'HOSTNAME'`) (Can be [obfuscated](#obfuscating_identifying_data))
        
    *   Public hostname (Can be [obfuscated](#obfuscating_identifying_data))
        
    *   Local IP addresses (Can be [obfuscated](#obfuscating_identifying_data))
        
    *   <a id="toggler-jvm-content"></a>Build Java Virtual Machine ▶
        
        <a id="jvm-content"></a>
        
        *   Vendor (system property `'java.vendor'`)
            
        *   Runtime name (system property `'java.runtime.name'`)
            
        *   Runtime version (system property `'java.runtime.version'`)
            
        *   Version (system property `'java.version'`)
            
        *   Class version (system property `'java.class.version'`)
            
        *   VM information (system property `'java.vm.info'`)
            
        *   VM name (system property `'java.vm.name'`)
            
        *   VM vendor (system property `'java.vm.vendor'`)
            
        *   VM version (system property `'java.vm.version'`)
            
        *   <a id="toggler-jvm-locale-content"></a>Locale ▶
            
            <a id="jvm-locale-content"></a>
            
            *   Language
                
            *   Country
                
            *   Variant
                
            *   Timezone
                
            
        *   Memory utilization and settings
            
        
    *   <a id="toggler-os-content"></a>Operating System ▶
        
        <a id="os-content"></a>
        
        *   Name (system property `'os.name'`)
            
        *   Version (system property `'os.version'`)
            
        *   Architecture (system property `'os.arch'`)
            
        *   Process names (Some can be [obfuscated](#obfuscating_identifying_data))
            
        *   CPU load of the build process
            
        *   CPU load of the build descendant processes
            
        *   Memory allocated to the build process
            
        *   Memory allocated to the build descendant processes
            
        
    *   <a id="toggler-hardware-content"></a>Hardware ▶
        
        <a id="hardware-content"></a>
        
        *   Number of processors
            
        *   CPU load of the system
            
        *   Total memory used by the system
            
        *   Network download/upload speeds across all non-local interfaces
            
        *   Disk read/write throughput across all disks
            
        
    
*   Build
    
    *   Build invocation options (e.g. requested tasks, switches)
        
    *   Build console output
        
    *   Build failure exception messages and stack traces
        
    *   <a id="toggler-build-deprecation-content"></a>Build deprecation ▶
        
        <a id="build-deprecation-content"></a>
        
        *   Messages
            
        *   Documentation URLs
            
        
    *   Project names and structure
        
    *   <a id="toggler-task-content"></a>Executed tasks ▶
        
        <a id="task-content"></a>
        
        *   Task name
            
        *   Task outcome
            
        *   Task dependencies
            
        *   Build Cache operations, including cache key
            
        *   Annotation processors
            
        *   Task input and output properties (excluding their values)
            
        
    *   <a id="toggler-build-tests-content"></a>Executed tests (using Gradle’s JVM Test task) ▶
        
        <a id="build-tests-content"></a>
        
        *   Configuration of a test task (e.g. number of parallel forks)
            
        *   Test names (e.g. class and method name), outcome and duration
            
        *   Console output
            
        *   Failure exception messages and stack traces
            
        *   Names and local hostnames of Test Distribution agents on which the tests ran
            
        *   Paths and sizes of files transferred to and from remote Test Distribution agents
            
        
    *   <a id="toggler-artifact-transform-content"></a>Artifact transforms ▶
        
        <a id="artifact-transform-content"></a>
        
        *   Artifact transform outcome
            
        *   Source and target variant of the transformed artifact
            
        *   Transformed artifact name
            
        *   Artifact transform dependencies
            
        *   Build Cache operations, including cache key
            
        *   Transform input and output properties (excluding their values)
            
        
    *   <a id="toggler-build-plugins-content"></a>Applied plugins ▶
        
        <a id="build-plugins-content"></a>
        
        *   ID
            
        *   Version number
            
        *   Implementation class name
            
        *   Origin (e.g. Gradle built-in or third party)
            
        
    *   <a id="toggler-build-dependencies-content"></a>Resolved dependencies ▶
        
        <a id="build-dependencies-content"></a>
        
        *   Identifiers and versions (e.g. `org.gradle:gradle-core:3.0`)
            
        *   Resolution failure error messages
            
        *   Origin repositories
            
        
    *   <a id="toggler-build-downloads-content"></a>Network downloads (performed by Gradle) ▶
        
        <a id="build-downloads-content"></a>
        
        *   Download time
            
        *   Download size
            
        *   Download location (including repository location)
            
        
    *   Build Cache configuration
        
    *   Background Build Scan publication
        
    *   Gradle Daemon operational data (e.g. start time, build count)
        
    *   Gradle lifecycle callbacks
        
    *   File system watching
        
    *   Configuration cache
        
    *   <a id="toggler-jvm-toolchains-content"></a>Java toolchains ▶
        
        <a id="jvm-toolchains-content"></a>
        
        *   Vendor (system property `'java.vendor'`)
            
        *   Runtime name (system property `'java.runtime.name'`)
            
        *   Runtime version (system property `'java.runtime.version'`)
            
        *   Version (system property `'java.version'`)
            
        *   VM name (system property `'java.vm.name'`)
            
        *   VM vendor (system property `'java.vm.vendor'`)
            
        *   VM version (system property `'java.vm.version'`)
            
        *   Architecture (system property `'os.arch'`)
            
        *   Used tool (Compiler, Runtime or Javadoc)
            
        
    

$(document).ready(function(){ $('\*\[id^="toggler"\]').on('click', function (e) { e.preventDefault(); var id = $(this).attr('id').replace('toggler-', ''); $("div\[id=" + id + "\]").toggleClass('hidden'); }); });

<a id="access"></a>

### Access

Build scans published to a Develocity installation are viewable by all users that can reach the server. Develocity provides a search interface for discovering and finding individual Build Scans.

Build Scans published to [Develocity at gradle.com](https://gradle.com/scans/gradle/) are viewable by anyone with the link assigned when publishing the Build Scan. Links to individual Build Scans are not discoverable and cannot be guessed, but may be shared.

<a id="compatibility-with-gradle-build-tool-and-develocity"></a>

## Appendix C: Compatibility With Gradle Build Tool and Develocity

Compatibility between versions of Gradle, Develocity, and the Develocity Gradle plugin can be found [here](https://docs.gradle.com/develocity/2026.1/miscellaneous/compatibility/#develocity_gradle_plugin).

<a id="verifying-the-signature-of-the-plugin-jar"></a>

## Appendix D: Verifying the Signature of the Plugin Jar

The plugin jar is published to plugins.gradle.org alongside its signature. The public key is published to [https://keys.openpgp.org](https://keys.openpgp.org). You can verify the signature as follows:

```shell
curl -OL https://plugins.gradle.org/m2/com/gradle/develocity-gradle-plugin/4.3.2/develocity-gradle-plugin-4.3.2.jar && \
  curl -OL https://plugins.gradle.org/m2/com/gradle/develocity-gradle-plugin/4.3.2/develocity-gradle-plugin-4.3.2.jar.asc && \
  gpg --keyserver keys.openpgp.org --recv-key 7B79ADD11F8A779FE90FD3D0893A028475557671 && \
  gpg --verify develocity-gradle-plugin-4.3.2.jar.asc develocity-gradle-plugin-4.3.2.jar
```

The output of the last command should look similar to the following:

```
gpg: Signature made Thu Sep 28 16:17:46 2023 CEST
gpg:                using RSA key 893A028475557671
gpg: Good signature from "Gradle Inc. <info@gradle.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7B79 ADD1 1F8A 779F E90F  D3D0 893A 0284 7555 7671
```

This verifies that the artifact was signed with the private key that corresponds to the imported public key. The warning is emitted because you haven’t explicitly trusted the imported key (therefore `[unknown]`). One way of establishing trust is to verify the fingerprint over a secure channel. Please contact technical support should you want to do so.