Skip to content

Commit e41a53c

Browse files
runningcodewilkinsona
authored andcommitted
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
1 parent f68671e commit e41a53c

File tree

8 files changed

+69
-0
lines changed

8 files changed

+69
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ transaction-logs
3838
secrets.yml
3939
.gradletasknamecache
4040
.sts4-cache
41+
.mvn/.gradle-enterprise/gradle-enterprise-workspace-id

.mvn/extensions.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<extensions>
2+
<extension>
3+
<groupId>com.gradle</groupId>
4+
<artifactId>gradle-enterprise-maven-extension</artifactId>
5+
<version>1.5.3</version>
6+
</extension>
7+
<extension>
8+
<groupId>io.spring.ge.conventions</groupId>
9+
<artifactId>gradle-enterprise-conventions-maven-extension</artifactId>
10+
<version>0.0.5</version>
11+
</extension>
12+
</extensions>

.mvn/gradle-enterprise.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<gradleEnterprise
2+
xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
4+
<server>
5+
<url>https://ge.spring.io</url>
6+
</server>
7+
<buildScan>
8+
<publishIfAuthenticated>true</publishIfAuthenticated>
9+
</buildScan>
10+
<buildCache>
11+
<local><enabled>true</enabled></local>
12+
</buildCache>
13+
</gradleEnterprise>

pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,38 @@
250250
</plugin>
251251
</plugins>
252252
</pluginManagement>
253+
<plugins>
254+
<plugin>
255+
<groupId>com.gradle</groupId>
256+
<artifactId>gradle-enterprise-maven-extension</artifactId>
257+
<!-- There is a build warning because we don't specify the version here. We do this instead of specifying the verison number twice -->
258+
<configuration>
259+
<gradleEnterprise>
260+
<plugins>
261+
<plugin>
262+
<artifactId>maven-checkstyle-plugin</artifactId>
263+
<inputs>
264+
<fileSets>
265+
<fileSet>
266+
<name>allowlist</name>
267+
<paths>
268+
<path>${main.basedir}/src/checkstyle</path>
269+
</paths>
270+
<normalization>RELATIVE_PATH</normalization>
271+
</fileSet>
272+
</fileSets>
273+
<properties>
274+
<property>
275+
<name>propertyExpansion</name>
276+
<value>ignoredValue</value>
277+
</property>
278+
</properties>
279+
</inputs>
280+
</plugin>
281+
</plugins>
282+
</gradleEnterprise>
283+
</configuration>
284+
</plugin>
285+
</plugins>
253286
</build>
254287
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file is empty so that the starters project does not generate multiple build scans.

spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
<addTestClassPath>true</addTestClassPath>
8989
<skipInvocation>${skipTests}</skipInvocation>
9090
<streamLogs>true</streamLogs>
91+
<properties>
92+
<scan>false</scan>
93+
</properties>
9194
</configuration>
9295
</execution>
9396
</executions>

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
<addTestClassPath>true</addTestClassPath>
154154
<skipInvocation>${skipTests}</skipInvocation>
155155
<streamLogs>true</streamLogs>
156+
<properties>
157+
<scan>false</scan>
158+
</properties>
156159
</configuration>
157160
</execution>
158161
</executions>

spring-boot-samples-invoker/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<pomIncludes>
3030
<pomInclude>pom.xml</pomInclude>
3131
</pomIncludes>
32+
<properties>
33+
<scan>false</scan>
34+
</properties>
3235
</configuration>
3336
<executions>
3437
<execution>

0 commit comments

Comments
 (0)