Skip to content

Commit 53bd88b

Browse files
author
Mark Pollack
committed
Commit the Maven wrapper jar and cache the wrapper's Maven distribution in CI
The .gitignore negation for the wrapper jar came before *.jar, so the jar was never committed and every CI job downloaded it from Maven Central; a 429 from Central failed the errorprone job on 03e4dea. The negation now follows *.jar. CI jobs also cache ~/.m2/wrapper, which setup-java's maven cache does not cover, so the Maven 3.8.6 distribution is not fetched on every run.
1 parent 8228548 commit 53bd88b

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
java-version: '17'
2828
distribution: 'temurin'
2929
cache: maven
30+
- name: Cache the Maven distribution the wrapper uses
31+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
32+
with:
33+
path: ~/.m2/wrapper
34+
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
3035

3136
- name: Build with Maven
3237
run: ./mvnw clean verify -B
@@ -55,6 +60,11 @@ jobs:
5560
java-version: '21'
5661
distribution: 'temurin'
5762
cache: maven
63+
- name: Cache the Maven distribution the wrapper uses
64+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
65+
with:
66+
path: ~/.m2/wrapper
67+
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
5868

5969
- name: Build with Maven (Error Prone and NullAway enforced)
6070
run: ./mvnw -B clean verify
@@ -75,6 +85,11 @@ jobs:
7585
java-version: '17'
7686
distribution: 'temurin'
7787
cache: maven
88+
- name: Cache the Maven distribution the wrapper uses
89+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
90+
with:
91+
path: ~/.m2/wrapper
92+
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
7893

7994
- name: Contention tests pinned to one CPU
8095
run: taskset -c 0 ./mvnw -B -pl acp-core -am test -Dtest='MultiPromptSyncSessionTest,AcpAgentSessionPromptLockTest' -Dsurefire.failIfNoSpecifiedTests=false
@@ -97,6 +112,11 @@ jobs:
97112
java-version: '17'
98113
distribution: 'temurin'
99114
cache: maven
115+
- name: Cache the Maven distribution the wrapper uses
116+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
117+
with:
118+
path: ~/.m2/wrapper
119+
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
100120

101121
# Install first rather than -am: a -Dtest filter would also reach the JSON modules,
102122
# which scan acp-core's test-jar for their contract tests.

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Maven/Gradle Builds ###
22
target/
33
.m2repo/
4-
!.mvn/wrapper/maven-wrapper.jar
54
!**/src/main/**/target/
65
!**/src/test/**/target/
76
build/
@@ -58,6 +57,8 @@ derby.log
5857

5958
### Package Files ###
6059
*.jar
60+
# The Maven wrapper jar is committed so mvnw needs no download; this must follow *.jar to win.
61+
!.mvn/wrapper/maven-wrapper.jar
6162
*.war
6263
*.nar
6364
*.ear

‎.mvn/wrapper/maven-wrapper.jar‎

58.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)