Skip to content

Commit efbc7f1

Browse files
Update github action maven.yml to make it faster
1 parent 4038b0c commit efbc7f1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/maven.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,18 @@ jobs:
3434
uses: actions/setup-java@v3
3535
with:
3636
java-version: ${{ matrix.java }}
37-
distribution: 'adopt'
37+
distribution: 'temurin'
3838
cache: maven
3939

40+
# Cache Maven dependencies (adjust cache key to optimize)
41+
- name: Cache Maven dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: ~/.m2/repository
45+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} # Cache dependencies based on pom.xml changes
46+
restore-keys: |
47+
${{ runner.os }}-maven-
48+
4049
# Build the project (compiles and packages the code)
4150
- name: Build the project
4251
run: mvn -B -X -e clean package --file pom.xml --batch-mode --fail-fast

0 commit comments

Comments
 (0)