Skip to content

Commit 9de8fc5

Browse files
committed
chore(305): use built-in Maven cache mechanism of setup-java GitHub
Action fixes #305 Signed-off-by: Aurélien Pupier <[email protected]>
1 parent 9b912c8 commit 9de8fc5

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

.github/workflows/build-project.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ jobs:
2828
with:
2929
path: /tmp/.buildx-cache
3030
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
31-
- name: Cache Maven packages
32-
uses: actions/cache@v4
33-
with:
34-
path: ~/.m2
35-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
36-
restore-keys: ${{ runner.os }}-m2
3731

3832
- name: Set up Docker Buildx
3933
id: buildx
@@ -43,6 +37,7 @@ jobs:
4337
with:
4438
distribution: 'zulu'
4539
java-version: '17'
40+
cache: 'maven'
4641

4742
- name: Create custom Maven Settings.xml
4843
uses: whelk-io/maven-settings-xml-action@v21

.github/workflows/release-please.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ jobs:
3232
with:
3333
path: /tmp/.buildx-cache
3434
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
35-
- name: Cache Maven packages
36-
if: ${{ steps.release.outputs.release_created }}
37-
uses: actions/cache@v4
38-
with:
39-
path: ~/.m2
40-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
41-
restore-keys: ${{ runner.os }}-m2
4235

4336
- name: Extract tag name
4437
if: ${{ steps.release.outputs.release_created }}
@@ -53,6 +46,7 @@ jobs:
5346
with:
5447
distribution: 'zulu'
5548
java-version: '17'
49+
cache: 'maven'
5650
- name: Set up Docker Buildx
5751
if: ${{ steps.release.outputs.release_created }}
5852
id: buildx

.github/workflows/sonarcloud-analysis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,13 @@ jobs:
5959
path: ~/.sonar/cache
6060
key: ${{ runner.os }}-sonar
6161
restore-keys: ${{ runner.os }}-sonar
62-
- name: Cache Maven packages
63-
uses: actions/cache@v4
64-
with:
65-
path: ~/.m2
66-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
67-
restore-keys: ${{ runner.os }}-m2
6862

6963
- name: Set up JDK 17
7064
uses: actions/setup-java@v4
7165
with:
7266
distribution: 'zulu'
7367
java-version: '17'
68+
cache: 'maven'
7469

7570
- name: Set Common Sonar Variables
7671
id: sonar_env

.github/workflows/sonarcloud-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,13 @@ jobs:
3636
path: ~/.sonar/cache
3737
key: ${{ runner.os }}-sonar
3838
restore-keys: ${{ runner.os }}-sonar
39-
- name: Cache Maven packages
40-
uses: actions/cache@v4
41-
with:
42-
path: ~/.m2
43-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44-
restore-keys: ${{ runner.os }}-m2
4539

4640
- name: Set up JDK 17
4741
uses: actions/setup-java@v4
4842
with:
4943
distribution: 'zulu'
5044
java-version: '17'
45+
cache: 'maven'
5146

5247
- name: Create custom Maven Settings.xml
5348
uses: whelk-io/maven-settings-xml-action@v21

0 commit comments

Comments
 (0)