From eda18793f2d65beba2af5746190671674f89e325 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 5 Apr 2024 15:00:23 +0200 Subject: [PATCH] Update to use DV Maven extension 1.21 and DV API --- ...en-data-capturing-samples-verification.yml | 2 +- build-caching-maven-samples/.gitignore | 2 +- .../{gradle-enterprise.xml => develocity.xml} | 7 ++---- .../.mvn/extensions.xml | 6 ++--- .../animal-sniffer-project/pom.xml | 6 ++--- .../antlr3-project/pom.xml | 6 ++--- .../asciidoctor-project/pom.xml | 6 ++--- .../aspectj-project/pom.xml | 8 +++---- .../avro-project/pom.xml | 6 ++--- .../clojure-project/pom.xml | 8 +++---- .../duplicate-finder-project/pom.xml | 6 ++--- .../enforcer-project/pom.xml | 6 ++--- .../exec-yarn-project/pom.xml | 6 ++--- .../kotlin-project/pom.xml | 6 ++--- .../pmd-project/pom.xml | 6 ++--- .../protobuf-project/pom.xml | 6 ++--- .../spotbugs-project/pom.xml | 6 ++--- .../spotless-project/pom.xml | 6 ++--- .../spring-cloud-contract-project/pom.xml | 6 ++--- .../webstart-project/pom.xml | 8 +++---- .../maven-os-processes.groovy | 4 ++-- .../maven-processor-arch.groovy | 4 ++-- .../capture-profiles/maven-profiles.groovy | 4 ++-- .../maven-quality-check-issues.groovy | 4 ++-- .../maven-top-level-project.groovy | 4 ++-- .../.gitignore | 2 +- .../{gradle-enterprise.xml => develocity.xml} | 12 ++++------ .../.mvn/extensions.xml | 6 ++--- .../gradle-2-through-4/settings.gradle | 2 +- .../plugins/gradle-5-or-newer/build.gradle | 2 +- .../create-custom-maven-distribution.sh | 24 +++++++++---------- .../{gradle-enterprise.xml => develocity.xml} | 11 ++++----- rollout-maven-extension/.mvn/extensions.xml | 6 ++--- rollout-maven-extension/README.md | 6 ++--- rollout-maven-extension/rollout.sh | 8 +++---- 35 files changed, 106 insertions(+), 112 deletions(-) rename build-caching-maven-samples/.mvn/{gradle-enterprise.xml => develocity.xml} (68%) rename common-develocity-maven-configuration/.mvn/{gradle-enterprise.xml => develocity.xml} (75%) rename rollout-maven-extension/.mvn/{gradle-enterprise.xml => develocity.xml} (64%) diff --git a/.github/workflows/maven-data-capturing-samples-verification.yml b/.github/workflows/maven-data-capturing-samples-verification.yml index a4ae8de08c..73afb771b8 100644 --- a/.github/workflows/maven-data-capturing-samples-verification.yml +++ b/.github/workflows/maven-data-capturing-samples-verification.yml @@ -42,7 +42,7 @@ jobs: - name: Provide data capture script to Maven build run: | # copy over sample script such that it gets pulled in by the Develocity extension - cp build-data-capturing-maven-samples/${{ matrix.sample-file }} common-develocity-maven-configuration/.mvn/gradle-enterprise-custom-user-data.groovy + cp build-data-capturing-maven-samples/${{ matrix.sample-file }} common-develocity-maven-configuration/.mvn/develocity-custom-user-data.groovy - name: Run Maven build id: mvn-build run: | diff --git a/build-caching-maven-samples/.gitignore b/build-caching-maven-samples/.gitignore index 89960d2e16..83806007ca 100644 --- a/build-caching-maven-samples/.gitignore +++ b/build-caching-maven-samples/.gitignore @@ -1,3 +1,3 @@ -.mvn/.gradle-enterprise/gradle-enterprise-workspace-id +.mvn/.develocity/develocity-workspace-id velocity.log diff --git a/build-caching-maven-samples/.mvn/gradle-enterprise.xml b/build-caching-maven-samples/.mvn/develocity.xml similarity index 68% rename from build-caching-maven-samples/.mvn/gradle-enterprise.xml rename to build-caching-maven-samples/.mvn/develocity.xml index 93f695af7d..cbc39aba01 100644 --- a/build-caching-maven-samples/.mvn/gradle-enterprise.xml +++ b/build-caching-maven-samples/.mvn/develocity.xml @@ -1,11 +1,8 @@ - + https://localhost true - - true - true @@ -14,4 +11,4 @@ false - + diff --git a/build-caching-maven-samples/.mvn/extensions.xml b/build-caching-maven-samples/.mvn/extensions.xml index 9414109cff..d91e415a38 100644 --- a/build-caching-maven-samples/.mvn/extensions.xml +++ b/build-caching-maven-samples/.mvn/extensions.xml @@ -1,12 +1,12 @@ com.gradle - gradle-enterprise-maven-extension - 1.20.1 + develocity-maven-extension + 1.21 com.gradle common-custom-user-data-maven-extension - 2 + 2.0 diff --git a/build-caching-maven-samples/animal-sniffer-project/pom.xml b/build-caching-maven-samples/animal-sniffer-project/pom.xml index 53d3791066..463eb66c7b 100644 --- a/build-caching-maven-samples/animal-sniffer-project/pom.xml +++ b/build-caching-maven-samples/animal-sniffer-project/pom.xml @@ -39,9 +39,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.codehaus.mojo @@ -116,7 +116,7 @@ - + diff --git a/build-caching-maven-samples/antlr3-project/pom.xml b/build-caching-maven-samples/antlr3-project/pom.xml index 47b67f33da..3db91f5378 100644 --- a/build-caching-maven-samples/antlr3-project/pom.xml +++ b/build-caching-maven-samples/antlr3-project/pom.xml @@ -59,9 +59,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.antlr @@ -117,7 +117,7 @@ - + diff --git a/build-caching-maven-samples/asciidoctor-project/pom.xml b/build-caching-maven-samples/asciidoctor-project/pom.xml index 5fa1650ed9..99b5c796f3 100644 --- a/build-caching-maven-samples/asciidoctor-project/pom.xml +++ b/build-caching-maven-samples/asciidoctor-project/pom.xml @@ -58,9 +58,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.asciidoctor @@ -174,7 +174,7 @@ - + diff --git a/build-caching-maven-samples/aspectj-project/pom.xml b/build-caching-maven-samples/aspectj-project/pom.xml index fb0aafd2bf..cdd50acbe5 100644 --- a/build-caching-maven-samples/aspectj-project/pom.xml +++ b/build-caching-maven-samples/aspectj-project/pom.xml @@ -2,7 +2,7 @@ + https://www.gradle.com/schema/develocity-maven-project.xsd"> 4.0.0 @@ -52,9 +52,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.codehaus.mojo @@ -345,7 +345,7 @@ - + diff --git a/build-caching-maven-samples/avro-project/pom.xml b/build-caching-maven-samples/avro-project/pom.xml index 1e34495bbb..968b42a88f 100644 --- a/build-caching-maven-samples/avro-project/pom.xml +++ b/build-caching-maven-samples/avro-project/pom.xml @@ -62,9 +62,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.apache.avro @@ -120,7 +120,7 @@ - + diff --git a/build-caching-maven-samples/clojure-project/pom.xml b/build-caching-maven-samples/clojure-project/pom.xml index 9baf8893b2..fda02dc679 100644 --- a/build-caching-maven-samples/clojure-project/pom.xml +++ b/build-caching-maven-samples/clojure-project/pom.xml @@ -1,6 +1,6 @@ + https://www.gradle.com/schema/develocity-maven-project.xsd"> 4.0.0 clojure-project jar @@ -57,9 +57,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + com.theoryinpractise @@ -212,7 +212,7 @@ - + diff --git a/build-caching-maven-samples/duplicate-finder-project/pom.xml b/build-caching-maven-samples/duplicate-finder-project/pom.xml index d830b607ce..de8c4cd7e6 100644 --- a/build-caching-maven-samples/duplicate-finder-project/pom.xml +++ b/build-caching-maven-samples/duplicate-finder-project/pom.xml @@ -42,9 +42,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.basepom.maven @@ -115,7 +115,7 @@ - + diff --git a/build-caching-maven-samples/enforcer-project/pom.xml b/build-caching-maven-samples/enforcer-project/pom.xml index 5e63828d15..b74b5eb7d1 100644 --- a/build-caching-maven-samples/enforcer-project/pom.xml +++ b/build-caching-maven-samples/enforcer-project/pom.xml @@ -94,9 +94,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.apache.maven.plugins @@ -224,7 +224,7 @@ - + diff --git a/build-caching-maven-samples/exec-yarn-project/pom.xml b/build-caching-maven-samples/exec-yarn-project/pom.xml index ee781ac41f..2f3ef47583 100644 --- a/build-caching-maven-samples/exec-yarn-project/pom.xml +++ b/build-caching-maven-samples/exec-yarn-project/pom.xml @@ -52,9 +52,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.codehaus.mojo @@ -174,7 +174,7 @@ - + diff --git a/build-caching-maven-samples/kotlin-project/pom.xml b/build-caching-maven-samples/kotlin-project/pom.xml index 64e8c61538..2d401b5eb5 100644 --- a/build-caching-maven-samples/kotlin-project/pom.xml +++ b/build-caching-maven-samples/kotlin-project/pom.xml @@ -66,9 +66,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.jetbrains.kotlin @@ -199,7 +199,7 @@ - + diff --git a/build-caching-maven-samples/pmd-project/pom.xml b/build-caching-maven-samples/pmd-project/pom.xml index c24ae6413e..c283596835 100644 --- a/build-caching-maven-samples/pmd-project/pom.xml +++ b/build-caching-maven-samples/pmd-project/pom.xml @@ -35,9 +35,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + maven-pmd-plugin @@ -295,7 +295,7 @@ - + diff --git a/build-caching-maven-samples/protobuf-project/pom.xml b/build-caching-maven-samples/protobuf-project/pom.xml index 983978a01d..f6a7681786 100644 --- a/build-caching-maven-samples/protobuf-project/pom.xml +++ b/build-caching-maven-samples/protobuf-project/pom.xml @@ -65,9 +65,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + com.github.os72 @@ -126,7 +126,7 @@ - + diff --git a/build-caching-maven-samples/spotbugs-project/pom.xml b/build-caching-maven-samples/spotbugs-project/pom.xml index 5ff0e9624d..ae29d02f54 100644 --- a/build-caching-maven-samples/spotbugs-project/pom.xml +++ b/build-caching-maven-samples/spotbugs-project/pom.xml @@ -39,9 +39,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + com.github.spotbugs @@ -154,7 +154,7 @@ - + diff --git a/build-caching-maven-samples/spotless-project/pom.xml b/build-caching-maven-samples/spotless-project/pom.xml index 875c76fd10..49f32d6520 100644 --- a/build-caching-maven-samples/spotless-project/pom.xml +++ b/build-caching-maven-samples/spotless-project/pom.xml @@ -51,9 +51,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + com.diffplug.spotless @@ -226,7 +226,7 @@ - + diff --git a/build-caching-maven-samples/spring-cloud-contract-project/pom.xml b/build-caching-maven-samples/spring-cloud-contract-project/pom.xml index c0a2fa1639..389aaa804a 100644 --- a/build-caching-maven-samples/spring-cloud-contract-project/pom.xml +++ b/build-caching-maven-samples/spring-cloud-contract-project/pom.xml @@ -62,9 +62,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.springframework.cloud @@ -206,7 +206,7 @@ - + diff --git a/build-caching-maven-samples/webstart-project/pom.xml b/build-caching-maven-samples/webstart-project/pom.xml index 52172b62ea..b2cd652b86 100644 --- a/build-caching-maven-samples/webstart-project/pom.xml +++ b/build-caching-maven-samples/webstart-project/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd https://www.gradle.com/schema/develocity-maven-project.xsd"> 4.0.0 webstart-project jar @@ -73,9 +73,9 @@ com.gradle - gradle-enterprise-maven-extension + develocity-maven-extension - + org.codehaus.mojo @@ -423,7 +423,7 @@ - + diff --git a/build-data-capturing-maven-samples/capture-os-processes/maven-os-processes.groovy b/build-data-capturing-maven-samples/capture-os-processes/maven-os-processes.groovy index fc8811219c..5de40c4f61 100644 --- a/build-data-capturing-maven-samples/capture-os-processes/maven-os-processes.groovy +++ b/build-data-capturing-maven-samples/capture-os-processes/maven-os-processes.groovy @@ -1,13 +1,13 @@ import java.nio.charset.Charset import java.util.concurrent.TimeUnit -import com.gradle.maven.extension.api.scan.BuildScanApi +import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter /** * This Groovy script captures the OS processes as reported by the OS 'ps' command, * and adds these as a custom value. */ -buildScan.executeOnce('os-processes') { BuildScanApi buildScanApi -> +buildScan.executeOnce('os-processes') { BuildScanApiAdapter buildScanApi -> buildScanApi.background { api -> captureOsProcesses(api) } diff --git a/build-data-capturing-maven-samples/capture-processor-arch/maven-processor-arch.groovy b/build-data-capturing-maven-samples/capture-processor-arch/maven-processor-arch.groovy index a002f45a55..3f7a492358 100644 --- a/build-data-capturing-maven-samples/capture-processor-arch/maven-processor-arch.groovy +++ b/build-data-capturing-maven-samples/capture-processor-arch/maven-processor-arch.groovy @@ -1,13 +1,13 @@ import java.nio.charset.Charset import java.util.concurrent.TimeUnit -import com.gradle.maven.extension.api.scan.BuildScanApi +import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter /** * This Groovy script captures the processor architecture * and adds these as a custom value. */ -buildScan.executeOnce('processor-arch') { BuildScanApi buildScanApi -> +buildScan.executeOnce('processor-arch') { BuildScanApiAdapter buildScanApi -> buildScanApi.background { api -> captureProcessorArch(api) } diff --git a/build-data-capturing-maven-samples/capture-profiles/maven-profiles.groovy b/build-data-capturing-maven-samples/capture-profiles/maven-profiles.groovy index 42c15552c4..fdc5e2ec59 100644 --- a/build-data-capturing-maven-samples/capture-profiles/maven-profiles.groovy +++ b/build-data-capturing-maven-samples/capture-profiles/maven-profiles.groovy @@ -1,9 +1,9 @@ -import com.gradle.maven.extension.api.scan.BuildScanApi +import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter /** * This Groovy script captures the active profiles and add them as tags to the Build Scan. */ -buildScan.executeOnce('tag-profiles') { BuildScanApi buildScanApi -> +buildScan.executeOnce('tag-profiles') { BuildScanApiAdapter buildScanApi -> project.activeProfiles.each { profile -> buildScanApi.tag profile.id } } diff --git a/build-data-capturing-maven-samples/capture-quality-check-issues/maven-quality-check-issues.groovy b/build-data-capturing-maven-samples/capture-quality-check-issues/maven-quality-check-issues.groovy index 1c7ccc370f..024a231fde 100644 --- a/build-data-capturing-maven-samples/capture-quality-check-issues/maven-quality-check-issues.groovy +++ b/build-data-capturing-maven-samples/capture-quality-check-issues/maven-quality-check-issues.groovy @@ -1,5 +1,5 @@ import java.nio.file.Paths -import com.gradle.maven.extension.api.scan.BuildScanApi +import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter @Grab(group='org.codehaus.groovy', module='groovy-xml', version='3.0.9') import groovy.util.XmlSlurper @@ -8,7 +8,7 @@ import groovy.util.XmlSlurper * and adds these as custom values. */ -buildScan.executeOnce('reporting-issues') { BuildScanApi buildScanApi -> +buildScan.executeOnce('reporting-issues') { BuildScanApiAdapter buildScanApi -> captureReportingIssues(buildScanApi) } diff --git a/build-data-capturing-maven-samples/capture-top-level-project/maven-top-level-project.groovy b/build-data-capturing-maven-samples/capture-top-level-project/maven-top-level-project.groovy index 80e668703c..e24c025a11 100644 --- a/build-data-capturing-maven-samples/capture-top-level-project/maven-top-level-project.groovy +++ b/build-data-capturing-maven-samples/capture-top-level-project/maven-top-level-project.groovy @@ -1,11 +1,11 @@ -import com.gradle.maven.extension.api.scan.BuildScanApi +import com.gradle.develocity.agent.maven.adapters.BuildScanApiAdapter /** * This Groovy script captures the top-level project name and artifact id, * and adds these as custom values. */ -buildScan.executeOnce('top-level-project') { BuildScanApi buildScanApi -> +buildScan.executeOnce('top-level-project') { BuildScanApiAdapter buildScanApi -> buildScanApi.value 'executionRoot.name', session.topLevelProject.name buildScanApi.value 'executionRoot.artifactId', session.topLevelProject.artifactId } diff --git a/common-develocity-maven-configuration/.gitignore b/common-develocity-maven-configuration/.gitignore index 7eb05c2d56..ac32af16b2 100644 --- a/common-develocity-maven-configuration/.gitignore +++ b/common-develocity-maven-configuration/.gitignore @@ -1,5 +1,5 @@ # Ignore Gradle project-specific cache directory -.mvn/.gradle-enterprise +.mvn/.develocity # Ignore Maven build output directory target diff --git a/common-develocity-maven-configuration/.mvn/gradle-enterprise.xml b/common-develocity-maven-configuration/.mvn/develocity.xml similarity index 75% rename from common-develocity-maven-configuration/.mvn/gradle-enterprise.xml rename to common-develocity-maven-configuration/.mvn/develocity.xml index 995b19bdd2..c5cf36fc8f 100644 --- a/common-develocity-maven-configuration/.mvn/gradle-enterprise.xml +++ b/common-develocity-maven-configuration/.mvn/develocity.xml @@ -1,6 +1,6 @@ - - + https://develocity-samples.gradle.com false - true #{isFalse(env['CI'])} - ALWAYS @@ -36,4 +34,4 @@ #{isTrue(env['CI'])} - + diff --git a/common-develocity-maven-configuration/.mvn/extensions.xml b/common-develocity-maven-configuration/.mvn/extensions.xml index 94a12e19ec..018f7cd53d 100644 --- a/common-develocity-maven-configuration/.mvn/extensions.xml +++ b/common-develocity-maven-configuration/.mvn/extensions.xml @@ -2,12 +2,12 @@ com.gradle - gradle-enterprise-maven-extension - 1.20.1 + develocity-maven-extension + 1.21 com.gradle common-custom-user-data-maven-extension - 1.13 + 2.0 diff --git a/convention-develocity-gradle-plugin/plugins/gradle-2-through-4/settings.gradle b/convention-develocity-gradle-plugin/plugins/gradle-2-through-4/settings.gradle index e4ce562f26..c546e80f4d 100644 --- a/convention-develocity-gradle-plugin/plugins/gradle-2-through-4/settings.gradle +++ b/convention-develocity-gradle-plugin/plugins/gradle-2-through-4/settings.gradle @@ -1,6 +1,6 @@ plugins { id 'com.gradle.enterprise' version '3.17' - id 'com.gradle.common-custom-user-data-gradle-plugin' version '2' + id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } diff --git a/convention-develocity-gradle-plugin/plugins/gradle-5-or-newer/build.gradle b/convention-develocity-gradle-plugin/plugins/gradle-5-or-newer/build.gradle index a2819b6a18..fcb149b8a7 100644 --- a/convention-develocity-gradle-plugin/plugins/gradle-5-or-newer/build.gradle +++ b/convention-develocity-gradle-plugin/plugins/gradle-5-or-newer/build.gradle @@ -13,7 +13,7 @@ repositories { dependencies { implementation 'com.gradle:gradle-enterprise-gradle-plugin:3.17' - implementation 'com.gradle:common-custom-user-data-gradle-plugin:2' + implementation 'com.gradle:common-custom-user-data-gradle-plugin:2.0' } java { diff --git a/custom-maven-distribution/create-custom-maven-distribution.sh b/custom-maven-distribution/create-custom-maven-distribution.sh index 8075ae2eb5..10e520b5d9 100755 --- a/custom-maven-distribution/create-custom-maven-distribution.sh +++ b/custom-maven-distribution/create-custom-maven-distribution.sh @@ -5,7 +5,7 @@ # # - Develocity Maven extension # - Common Custom User Data Maven extension that captures additional build metadata -# - gradle-enterprise.xml with typical configuration for CI and developers building locally +# - develocity.xml with typical configuration for CI and developers building locally # # Ideally, the custom Maven distribution is then # @@ -32,13 +32,13 @@ maven_conf=${maven_dir}/conf custom_maven_version=1.0.0 custom_maven_zip=${maven_dir}-sample-${custom_maven_version}-bin.zip -develocity_ext_version=1.20 -develocity_ext_jar=gradle-enterprise-maven-extension-${develocity_ext_version}.jar +develocity_ext_version=1.21 +develocity_ext_jar=develocity-maven-extension-${develocity_ext_version}.jar -develocity_sample_ext_version=1.13 +develocity_sample_ext_version=2.0 develocity_sample_ext_jar=common-custom-user-data-maven-extension-${develocity_sample_ext_version}.jar -develocity_sample_ext_xml=gradle-enterprise.xml +develocity_sample_ext_xml=develocity.xml server_url= @@ -71,7 +71,7 @@ unzip -q $tmp_dir/$maven_zip -d $out_dir if [ ! -f "$tmp_dir/$develocity_ext_jar" ]; then echo -e "${yellow}Downloading Develocity Maven extension $develocity_ext_version${nc}" - develocity_ext_download_url=https://repo1.maven.org/maven2/com/gradle/gradle-enterprise-maven-extension/${develocity_ext_version}/${develocity_ext_jar} + develocity_ext_download_url=https://repo1.maven.org/maven2/com/gradle/develocity-maven-extension/${develocity_ext_version}/${develocity_ext_jar} wget $develocity_ext_download_url -P $tmp_dir fi @@ -89,21 +89,21 @@ fi echo -e "${yellow}Copying common custom user data capturing Maven extension into Maven distribution${nc}" cp $tmp_dir/$develocity_sample_ext_jar $out_dir/$maven_lib_ext -### Downloading and embedding common gradle-enterprise.xml configuration for CI builds and developers building locally +### Downloading and embedding common develocity.xml configuration for CI builds and developers building locally if [ ! -f "$tmp_dir/$develocity_sample_ext_xml" ]; then - echo -e "${yellow}Downloading common gradle-enterprise.xml configuration for CI builds and developers building locally${nc}" - develocity_sample_ext_xml_download_url=https://raw.githubusercontent.com/gradle/gradle-enterprise-build-config-samples/master/common-develocity-maven-configuration/.mvn/${develocity_sample_ext_xml} + echo -e "${yellow}Downloading common develocity.xml configuration for CI builds and developers building locally${nc}" + develocity_sample_ext_xml_download_url=https://raw.githubusercontent.com/gradle/develocity-build-config-samples/master/common-develocity-maven-configuration/.mvn/${develocity_sample_ext_xml} wget $develocity_sample_ext_xml_download_url -P $tmp_dir fi -echo -e "${yellow}Copying common gradle-enterprise.xml for developers building locally into Maven distribution${nc}" +echo -e "${yellow}Copying common develocity.xml for developers building locally into Maven distribution${nc}" cp $tmp_dir/$develocity_sample_ext_xml $out_dir/$maven_conf -### If present, replace the default urls in the gradle-enterprise.xml file with the url passed on the command line +### If present, replace the default urls in the develocity.xml file with the url passed on the command line if [ -n "$server_url" ]; then - echo -e "${yellow}Replacing the urls in gradle-enterprise.xml with ${server_url}${nc}" + echo -e "${yellow}Replacing the urls in develocity.xml with ${server_url}${nc}" sed -i '' -e 's+https://develocity-samples.gradle.com+'"$server_url"'+g' $out_dir/$maven_conf/$develocity_sample_ext_xml fi diff --git a/rollout-maven-extension/.mvn/gradle-enterprise.xml b/rollout-maven-extension/.mvn/develocity.xml similarity index 64% rename from rollout-maven-extension/.mvn/gradle-enterprise.xml rename to rollout-maven-extension/.mvn/develocity.xml index 0a90d79375..9611270502 100644 --- a/rollout-maven-extension/.mvn/gradle-enterprise.xml +++ b/rollout-maven-extension/.mvn/develocity.xml @@ -3,17 +3,16 @@ - + https://develocity-samples.gradle.com - true #{isFalse(env['CI'])} @@ -25,4 +24,4 @@ #{isTrue(env['CI'])} - + diff --git a/rollout-maven-extension/.mvn/extensions.xml b/rollout-maven-extension/.mvn/extensions.xml index f02c9b5ab3..6fa6f167f2 100644 --- a/rollout-maven-extension/.mvn/extensions.xml +++ b/rollout-maven-extension/.mvn/extensions.xml @@ -6,12 +6,12 @@ com.gradle - gradle-enterprise-maven-extension - 1.20 + develocity-maven-extension + 1.21 com.gradle common-custom-user-data-maven-extension - 1.13 + 2.0 diff --git a/rollout-maven-extension/README.md b/rollout-maven-extension/README.md index 4fda2188f7..f1266f6f0d 100644 --- a/rollout-maven-extension/README.md +++ b/rollout-maven-extension/README.md @@ -8,10 +8,10 @@ The Develocity Maven Extension rollout script provides a means to automate the a 1. Update the `repositories.txt` file with the list of Git repositories you want to apply the extension on. Make sure each line contains a single Git repository URL. -1. Update the Maven `.mvn/extensions.xml` and the Develocity `.mvn/gradle-enterprise.xml` files with your desired Develocity configuration. +1. Update the Maven `.mvn/extensions.xml` and the Develocity `.mvn/develocity.xml` files with your desired Develocity configuration. 1. Run the `./rollout.sh` bash script to execute the Develocity configuration rollout. The script supports the following command line arguments: * `-u`: Only update those Git repositories that already contain the `.mvn` folder where the configuration files are stored. - * `-f`: Force-override any pre-existing `extensions.xml` and `gradle-enterprise.xml` configuration files in the `.mvn` folder. + * `-f`: Force-override any pre-existing `extensions.xml` and `develocity.xml` configuration files in the `.mvn` folder. * `-p`: Push the applied changes to the listed Git repositories. Omit the `-p` flag to do a dry run. ### How it works @@ -22,7 +22,7 @@ The script creates a temporary folder and clones the listed Git repositories to If the `-u` flag is specified, the script only processes those repositories that already contain a `.mvn` folder. If the `-u` flag is not specified, the script will process all repositories and create the `.mvn` folder for those repositories that do not already contain it. -For each processed repository, if the `-f` flag is specified, any pre-existing `extensions.xml` and `gradle-enterprise.xml` configuration files in the `.mvn` folder are overridden. +For each processed repository, if the `-f` flag is specified, any pre-existing `extensions.xml` and `develocity.xml` configuration files in the `.mvn` folder are overridden. If the `-f` flag is not specified, any pre-existing configuration files are not modified. The modifications are committed to the cloned repository. For each repository, if the `-p` flag is specified, the committed changes are pushed to the remote Git repository, and the temporary folder is deleted once all repositories have been processed. diff --git a/rollout-maven-extension/rollout.sh b/rollout-maven-extension/rollout.sh index 96894056bb..d9c9e82061 100755 --- a/rollout-maven-extension/rollout.sh +++ b/rollout-maven-extension/rollout.sh @@ -73,16 +73,16 @@ function process_repository() { cp -na "$basedir"/.mvn/. .mvn fi - # update .gitignore file to ignore the .mvn/.gradle-enterprise folder + # update .gitignore file to ignore the .mvn/.develocity folder if git checkout -- .gitignore >& /dev/null then # .gitignore file already exists - if ! grep -Fxq ".mvn/.gradle-enterprise/" .gitignore ; then - echo ".mvn/.gradle-enterprise/" >> .gitignore + if ! grep -Fxq ".mvn/.develocity/" .gitignore ; then + echo ".mvn/.develocity/" >> .gitignore fi else # .gitignore file does not already exist - echo ".mvn/.gradle-enterprise/" > .gitignore + echo ".mvn/.develocity/" > .gitignore fi # add changes to staging and commit