Skip to content

Commit 34b4adb

Browse files
committed
Updates to Maven caching for Github Actions
1 parent 361cae4 commit 34b4adb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ jobs:
5454
distribution: liberica
5555
java-version: 21
5656

57-
- name: Cache Maven packages
57+
- name: Cache local Maven repository
5858
uses: actions/cache@v4
5959
with:
60-
path: ~/.m2
61-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
62-
restore-keys: ${{ runner.os }}-m2
60+
path: ~/.m2/repository
61+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
62+
restore-keys: |
63+
${{ runner.os }}-maven-
6364
6465
# Initializes the CodeQL tools for scanning.
6566
- name: Initialize CodeQL

.github/workflows/maven.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
with:
1717
distribution: liberica
1818
java-version: ${{ matrix.java }}
19-
- name: Cache Maven packages
19+
- name: Cache local Maven repository
2020
uses: actions/cache@v4
2121
with:
22-
path: ~/.m2
23-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
24-
restore-keys: ${{ runner.os }}-m2
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
2526
- name: Build with Maven
2627
run: ./mvnw --batch-mode --update-snapshots -DskipTests -P production verify

0 commit comments

Comments
 (0)