Maven extension that enhances published build scans by adding a set of tags, links and custom values that have proven to be useful for many projects building with Develocity.
APACHE-2.0 License
This repository is maintained by the Develocity Solutions team, as one of several publicly available repositories:
The Common Custom User Data Maven extension for Develocity enhances published build scans by adding a set of tags, links and custom values that have proven to be useful for many projects building with Develocity.
You can leverage this extension for your project in one of two ways:
.mvn/extensions.xml
and immediately benefit from enhanced build scansThe Common Custom User Data Maven extension is available in Maven Central. This extension requires the Develocity Maven extension to also be applied in your build in order to have an effect.
In order for the Common Custom User Data Maven extension to become active, you need to register it in the .mvn/extensions.xml
file in your root project. The extensions.xml
file
is the same file where you have already declared the Develocity Maven extension.
See here for an example.
This table details the version compatibility of the Common Custom User Data Maven extension with the Develocity Maven extension.
Common Custom User Data Maven extension versions | Develocity Maven extension versions |
---|---|
1.8+ |
1.11+ |
1.7 - 1.7.3
|
1.10.1+ |
1.3 - 1.6
|
1.6.5+ |
1.0 - 1.2
|
1.0+ |
The above chart captures the minimum compatible versions. For the best experience with the Develocity Maven extension 1.21 or higher, we recommend using the Common Custom User Data Maven extension 2.0 or higher.
The additional tags, links and custom values captured by this extension include:
See CustomBuildScanEnhancements.java for details on what data is captured and under which conditions.
You can apply additional configuration beyond what is contributed by the Common Custom User Data Maven extension by default. The additional configuration happens in a specific Groovy script. This is a good intermediate step before creating your own extension.
The Common Custom User Data Maven extension checks for a .mvn/develocity-custom-user-data.groovy
or .mvn/gradle-enterprise-custom-user-data.groovy
Groovy script in your root project. If the file exists, it evaluates
the script with the following bindings:
develocity/gradleEnterprise
(type: DevelocityAdapter): configure Develocity
buildScan
(type: BuildScanApiAdapter): configure build scan publishing and enhance build scans
buildCache
(type: BuildCacheApiAdapter): configure build cache
log
(type: Logger
): write to the build log
project
(type: MavenProject
): the top-level Maven project
session
(type: MavenSession
): the Maven session
See here for an example.
For more flexibility, we recommend creating a copy of this repository so that you may develop a customized version of the extension and publish it internally for your projects to consume.
This approach has a number of benefits:
If your customized extension provides all required Develocity configuration, then a consumer project will get all the benefits of Develocity simply by applying the extension. The project sources provide a good template to get started with your own extension.
Refer to the Javadoc for more details on the key types available for use.
Refer to the release history to see detailed changes on the versions.
When updating to the Common Custom User Data Maven extension 2.0, please take care of the following.
.mvn/gradle-enterprise-custom-user-data.groovy
to .mvn/develocity-custom-user-data.groovy
.BuildScanApiAdapter
instead of BuildScanApi
. See the example below:gradle-enterprise-custom-user-data.groovy
import com.gradle.maven.extension.api.scan.BuildScanApi
buildScan.executeOnce('top-level-project') { BuildScanApi buildScanApi -> }
develocity-custom-user-data.groovy
import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter
buildScan.executeOnce('top-level-project') { BuildScanApiAdapter buildScanApi -> }
Visit our website to learn more about Develocity.
The Develocity Common Custom User Data Maven extension is open-source software released under the Apache 2.0 License.