From e41a53cf85f0dee0aeb0189a538655d51c0d87ea Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 5 Jun 2020 14:40:55 +0200 Subject: [PATCH 1/2] Add Gradle Enterprise Extension This adds build caching and build scans. The changes required disabling scans when using the maven invoker plugin in order to not cause duplicate build scans when invoking other maven builds. There is also an empty `.mvn` folder in the spring-boot-starters project to prevent duplicate build scans as well since there is no way to pass properties to the maven-javadoc-plugin. The checkstyle plugin was causing a cache miss with the `propertyExpansion` because it contains an absolute path. The absolute path is now ignored and instead the files are added as inputs to the checkstyle plugin. This only enables the local build cache. The remote cache is not yet enabled. On my local machine: ./mvnw clean install build times go from about 30 minutes to about 10 minutes. ./mvnw clean install -Pfull build times go from about 60 minutes to about 13 minutes. See gh-22089 --- .gitignore | 1 + .mvn/extensions.xml | 12 +++++++ .mvn/gradle-enterprise.xml | 13 ++++++++ pom.xml | 33 +++++++++++++++++++ .../.mvn/empty-file-for-mvn | 1 + .../spring-boot-loader/pom.xml | 3 ++ .../spring-boot-maven-plugin/pom.xml | 3 ++ spring-boot-samples-invoker/pom.xml | 3 ++ 8 files changed, 69 insertions(+) create mode 100644 .mvn/extensions.xml create mode 100644 .mvn/gradle-enterprise.xml create mode 100644 spring-boot-project/spring-boot-starters/.mvn/empty-file-for-mvn diff --git a/.gitignore b/.gitignore index 9c1e3d013d..0b836fe4ea 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ transaction-logs secrets.yml .gradletasknamecache .sts4-cache +.mvn/.gradle-enterprise/gradle-enterprise-workspace-id \ No newline at end of file diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 0000000000..4f01a30e01 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,12 @@ + + + com.gradle + gradle-enterprise-maven-extension + 1.5.3 + + + io.spring.ge.conventions + gradle-enterprise-conventions-maven-extension + 0.0.5 + + \ No newline at end of file diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml new file mode 100644 index 0000000000..978dcbbd2f --- /dev/null +++ b/.mvn/gradle-enterprise.xml @@ -0,0 +1,13 @@ + + + https://ge.spring.io + + + true + + + true + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3557f73abc..96d333d2fa 100644 --- a/pom.xml +++ b/pom.xml @@ -250,5 +250,38 @@ + + + com.gradle + gradle-enterprise-maven-extension + + + + + + maven-checkstyle-plugin + + + + allowlist + + ${main.basedir}/src/checkstyle + + RELATIVE_PATH + + + + + propertyExpansion + ignoredValue + + + + + + + + + diff --git a/spring-boot-project/spring-boot-starters/.mvn/empty-file-for-mvn b/spring-boot-project/spring-boot-starters/.mvn/empty-file-for-mvn new file mode 100644 index 0000000000..6db7e363e9 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/.mvn/empty-file-for-mvn @@ -0,0 +1 @@ +This file is empty so that the starters project does not generate multiple build scans. \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml index 4f821144ba..fb238133be 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml @@ -88,6 +88,9 @@ true ${skipTests} true + + false + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml index 36d042b399..cf43bc61ca 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml @@ -153,6 +153,9 @@ true ${skipTests} true + + false + diff --git a/spring-boot-samples-invoker/pom.xml b/spring-boot-samples-invoker/pom.xml index 1b6538aaf9..bd3821f631 100644 --- a/spring-boot-samples-invoker/pom.xml +++ b/spring-boot-samples-invoker/pom.xml @@ -29,6 +29,9 @@ pom.xml + + false + From 60ff87155f89f67b82910b77c23da23c0ffb714c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 26 Jun 2020 17:57:44 +0100 Subject: [PATCH 2/2] Polish "Add Gradle Enterprise Extension" See gh-22089 --- .mvn/gradle-enterprise.xml | 32 ++++++++++++++++++++++---------- ci/scripts/stage.sh | 8 ++++---- pom.xml | 2 +- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml index 978dcbbd2f..dd73b91676 100644 --- a/.mvn/gradle-enterprise.xml +++ b/.mvn/gradle-enterprise.xml @@ -1,13 +1,25 @@ - - https://ge.spring.io - - - true - - - true - - \ No newline at end of file + + https://ge.spring.io + + + true + + + + true + + + true + + + + ${env.GRADLE_ENTERPRISE_CACHE_USERNAME} + ${env.GRADLE_ENTERPRISE_CACHE_PASSWORD} + + + + + diff --git a/ci/scripts/stage.sh b/ci/scripts/stage.sh index b8ecc4f625..59c24e6a2e 100755 --- a/ci/scripts/stage.sh +++ b/ci/scripts/stage.sh @@ -35,10 +35,10 @@ git add pom.xml > /dev/null git commit -m"Release v$stageVersion" > /dev/null git tag -a "v$stageVersion" -m"Release v$stageVersion" > /dev/null -run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository} -run_maven -f spring-boot-samples/pom.xml clean install -U -Dfull -Drepository=file://${repository} -run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} +run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository} -Dgradle.cache.local.enabled=false -Dgradle.cache.remote.enabled=false +run_maven -f spring-boot-samples/pom.xml clean install -U -Dfull -Drepository=file://${repository} -Dgradle.cache.local.enabled=false -Dgradle.cache.remote.enabled=false +run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -Dgradle.cache.local.enabled=false -Dgradle.cache.remote.enabled=false +run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -Dgradle.cache.local.enabled=false -Dgradle.cache.remote.enabled=false git reset --hard HEAD^ > /dev/null if [[ $nextVersion != $snapshotVersion ]]; then diff --git a/pom.xml b/pom.xml index 96d333d2fa..f74508bb8d 100644 --- a/pom.xml +++ b/pom.xml @@ -254,7 +254,7 @@ com.gradle gradle-enterprise-maven-extension - + 1.5.2