Skip to content

Commit 2029f7f

Browse files
authored
Merge pull request #1399 from gradle/erichaagdev/re-enable-maven-caching-samples
Maven build caching samples are re-enabled
2 parents 2481c5f + 65364b6 commit 2029f7f

File tree

5 files changed

+126
-112
lines changed

5 files changed

+126
-112
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Verify Maven Build Caching Samples
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: [ 'build-caching-maven-samples/**', '.github/workflows/**' ]
7+
pull_request:
8+
branches: [ main ]
9+
paths: [ 'build-caching-maven-samples/**', '.github/workflows/**' ]
10+
workflow_dispatch:
11+
12+
env:
13+
PROJECT_DIR: build-caching-maven-samples
14+
GOALS: verify
15+
ARGS: -B -Ddevelocity.cache.failOnUnhandledParameters=true
16+
17+
jobs:
18+
verification:
19+
name: Verification
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
- name: Set up Maven
28+
uses: gradle/develocity-actions/[email protected]
29+
with:
30+
develocity-access-key: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
31+
- name: Setup Node.js and Npm
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '14'
35+
- name: Set up Yarn
36+
run: npm install -g yarn
37+
- name: Download latest version of the Develocity Build Validation Scripts
38+
uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/download@actions-stable
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Run experiment 1
42+
uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-1@actions-stable
43+
with:
44+
gitRepo: ${{ github.server_url }}/${{ github.repository }}
45+
gitCommitId: ${{ github.sha }}
46+
projectDir: ${{ env.PROJECT_DIR }}
47+
goals: ${{ env.GOALS }}
48+
args: ${{ env.ARGS }}
49+
failIfNotFullyCacheable: true
50+
- name: Run experiment 2
51+
uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable
52+
with:
53+
gitRepo: ${{ github.server_url }}/${{ github.repository }}
54+
gitCommitId: ${{ github.sha }}
55+
projectDir: ${{ env.PROJECT_DIR }}
56+
goals: ${{ env.GOALS }}
57+
args: ${{ env.ARGS }}
58+
failIfNotFullyCacheable: true

.github/workflows/maven-build-caching-samples-verification.yml.disabled

Lines changed: 0 additions & 49 deletions
This file was deleted.

build-caching-maven-samples/.mvn/develocity.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
<develocity>
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<develocity
3+
xmlns="https://www.gradle.com/develocity-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.gradle.com/develocity-maven https://www.gradle.com/schema/develocity-maven.xsd">
25
<server>
36
<url>https://ge.solutions-team.gradle.com</url>
4-
<allowUntrusted>true</allowUntrusted>
57
</server>
8+
<buildScan>
9+
<backgroundBuildScanUpload>#{isFalse(env['GITHUB_ACTIONS'])}</backgroundBuildScanUpload>
10+
<publishing>
11+
<onlyIf>
12+
<![CDATA[authenticated]]>
13+
</onlyIf>
14+
</publishing>
15+
<obfuscation>
16+
<ipAddresses>#{{'0.0.0.0'}}</ipAddresses>
17+
</obfuscation>
18+
</buildScan>
619
<buildCache>
720
<local>
821
<enabled>true</enabled>

build-caching-maven-samples/avro-project/pom.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,19 @@
8787
</fileSet>
8888
</fileSets>
8989
<properties>
90+
<property><name>createNullSafeAnnotations</name></property>
9091
<property><name>createOptionalGetters</name></property>
9192
<property><name>createSetters</name></property>
93+
<property><name>customConversions</name></property>
94+
<property><name>customLogicalTypeFactories</name></property>
9295
<property><name>enableDecimalLogicalType</name></property>
96+
<property><name>errorSpecificClass</name></property>
97+
<property><name>fieldVisibility</name></property>
9398
<property><name>gettersReturnOptional</name></property>
99+
<property><name>imports</name></property>
94100
<property><name>optionalGettersForNullableFieldsOnly</name></property>
95-
101+
<property><name>recordSpecificClass</name></property>
96102
<property><name>stringType</name></property>
97-
<property><name>imports</name></property>
98-
<property><name>fieldVisibility</name></property>
99-
100-
<property><name>customConversions</name></property>
101-
<property><name>customLogicalTypeFactories</name></property>
102103
<property><name>templateDirectory</name></property>
103104
<property><name>velocityToolsClassesNames</name></property>
104105
</properties>

build-caching-maven-samples/pmd-project/pom.xml

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,35 @@
6868
<name>excludeFromFailureFile</name>
6969
<normalization>NAME_ONLY</normalization>
7070
</fileSet>
71+
<fileSet>
72+
<name>siteDirectory</name>
73+
</fileSet>
7174
</fileSets>
72-
7375
<properties>
74-
<property><name>skip</name></property>
76+
<property><name>aggregate</name></property>
77+
<property><name>benchmark</name></property>
7578
<property><name>format</name></property>
76-
<property><name>linkXRef</name></property>
7779
<property><name>includeTests</name></property>
78-
<property><name>aggregate</name></property>
80+
<property><name>includeXmlInReports</name></property>
7981
<property><name>inputEncoding</name></property>
80-
<property><name>includeXmlInSite</name></property>
81-
<property><name>skipEmptyReport</name></property>
8282
<property><name>jdkToolchain</name></property>
83-
<property><name>targetJdk</name></property>
8483
<property><name>language</name></property>
84+
<property><name>linkXRef</name></property>
85+
<property><name>locale</name></property>
8586
<property><name>minimumPriority</name></property>
86-
<property><name>rulesets</name></property>
87-
<property><name>typeResolution</name></property>
88-
<property><name>benchmark</name></property>
89-
<property><name>suppressMarker</name></property>
90-
<property><name>skipPmdError</name></property>
87+
<property><name>outputFormat</name></property>
88+
<property><name>outputTimestamp</name></property>
9189
<property><name>renderProcessingErrors</name></property>
9290
<property><name>renderRuleViolationPriority</name></property>
9391
<property><name>renderSuppressedViolations</name></property>
9492
<property><name>renderViolationsByPriority</name></property>
93+
<property><name>rulesets</name></property>
94+
<property><name>skip</name></property>
95+
<property><name>skipEmptyReport</name></property>
96+
<property><name>skipPmdError</name></property>
97+
<property><name>suppressMarker</name></property>
98+
<property><name>targetJdk</name></property>
99+
<property><name>typeResolution</name></property>
95100
</properties>
96101
<ignoredProperties>
97102
<!-- Ignore property that has no impact on plugin outputs -->
@@ -124,26 +129,17 @@
124129
<!-- In general this is unimportant, since `clean` will remove the analysis cache. -->
125130
<ignore>analysisCache</ignore>
126131
<ignore>analysisCacheLocation</ignore>
132+
133+
<!-- Maven project state cannot be part of cache key. -->
134+
<ignore>mojoExecution</ignore>
135+
136+
<!-- Maven project state cannot be part of cache key. -->
137+
<ignore>repoSession</ignore>
127138
</ignoredProperties>
128139
</inputs>
129-
<nestedProperties>
130-
<property>
131-
<name>localRepository</name>
132-
<inputs>
133-
<properties>
134-
<property>
135-
<name>id</name>
136-
</property>
137-
<property>
138-
<name>url</name>
139-
</property>
140-
</properties>
141-
</inputs>
142-
</property>
143-
</nestedProperties>
144140
<iteratedProperties>
145141
<property>
146-
<name>remoteRepositories</name>
142+
<name>remoteProjectRepositories</name>
147143
<inputs>
148144
<properties>
149145
<property>
@@ -197,24 +193,28 @@
197193
<name>excludeFromFailureFile</name>
198194
<normalization>NAME_ONLY</normalization>
199195
</fileSet>
196+
<fileSet>
197+
<name>siteDirectory</name>
198+
</fileSet>
200199
</fileSets>
201200
<properties>
202-
<property><name>skip</name></property>
201+
<property><name>aggregate</name></property>
203202
<property><name>format</name></property>
204-
<property><name>linkXRef</name></property>
203+
<property><name>ignoreAnnotations</name></property>
204+
<property><name>ignoreIdentifiers</name></property>
205+
<property><name>ignoreLiterals</name></property>
205206
<property><name>includeTests</name></property>
206-
<property><name>aggregate</name></property>
207+
<property><name>includeXmlInReports</name></property>
207208
<property><name>inputEncoding</name></property>
208-
<property><name>includeXmlInSite</name></property>
209-
<property><name>skipEmptyReport</name></property>
210-
<property><name>language</name></property>
211209
<property><name>jdkToolchain</name></property>
212-
213-
<property><name>ignoreAnnotations</name></property>
214-
<property><name>ignoreLiterals</name></property>
215-
<property><name>ignoreIdentifiers</name></property>
210+
<property><name>language</name></property>
211+
<property><name>linkXRef</name></property>
212+
<property><name>locale</name></property>
216213
<property><name>minimumTokens</name></property>
217-
214+
<property><name>outputFormat</name></property>
215+
<property><name>outputTimestamp</name></property>
216+
<property><name>skip</name></property>
217+
<property><name>skipEmptyReport</name></property>
218218
</properties>
219219
<ignoredProperties>
220220
<!-- Ignore property that has no impact on plugin outputs -->
@@ -240,26 +240,17 @@
240240
<!-- Ignored because no single property represents each output reports. -->
241241
<!-- There is no way to automatically combine this property value and the 'format' into a single output file name. -->
242242
<ignore>targetDirectory</ignore>
243+
244+
<!-- Maven project state cannot be part of cache key. -->
245+
<ignore>mojoExecution</ignore>
246+
247+
<!-- Maven project state cannot be part of cache key. -->
248+
<ignore>repoSession</ignore>
243249
</ignoredProperties>
244250
</inputs>
245-
<nestedProperties>
246-
<property>
247-
<name>localRepository</name>
248-
<inputs>
249-
<properties>
250-
<property>
251-
<name>id</name>
252-
</property>
253-
<property>
254-
<name>url</name>
255-
</property>
256-
</properties>
257-
</inputs>
258-
</property>
259-
</nestedProperties>
260251
<iteratedProperties>
261252
<property>
262-
<name>remoteRepositories</name>
253+
<name>remoteProjectRepositories</name>
263254
<inputs>
264255
<properties>
265256
<property>

0 commit comments

Comments
 (0)