Skip to content

Commit dafc40c

Browse files
committed
ci(github-actions): enable maven caching
1 parent 5d3c06d commit dafc40c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/maven.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ jobs:
5858
with:
5959
distribution: temurin
6060
java-version: ${{ matrix.java }}
61+
- name: Cache Maven dependencies
62+
# The build redirects the local repo to .m2/repository (see
63+
# -Dmaven.repo.local in MAVEN_OPTS), so cache it at the location the
64+
# build actually uses rather than setup-java's default ~/.m2/repository.
65+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
66+
with:
67+
path: .m2/repository
68+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
69+
restore-keys: |
70+
${{ runner.os }}-maven-
6171
- name: Build with Maven
6272
shell: bash
6373
run: |

0 commit comments

Comments
 (0)