@@ -11,18 +11,48 @@ inputs:
1111 distribution :
1212 default : ' corretto'
1313 description : ' Java Distribution'
14+ cache :
15+ default : ' true'
16+ description : ' Enable Maven dependency caching'
17+ cache-name :
18+ default : ' aboutbits-setup-java'
19+ description : ' Cache name. Caches with the same name will share their contents.'
20+
21+ outputs :
22+ distribution :
23+ description : ' Distribution of Java that has been installed'
24+ value : ${{ steps.setup-java.outputs.distribution }}
25+ version :
26+ description : ' Actual version of the java environment that has been installed'
27+ value : ${{ steps.setup-java.outputs.version }}
28+ path :
29+ description : ' Path to where the java environment has been installed (same as $JAVA_HOME)'
30+ value : ${{ steps.setup-java.outputs.path }}
31+ cache-hit :
32+ description : ' A boolean value to indicate an exact match was found for the primary key'
33+ value : ${{ steps.cache.outputs.cache-hit }}
1434
1535runs :
1636 using : " composite"
1737 steps :
1838 - name : Set up JDK
1939 uses : actions/setup-java@v4
40+ id : setup-java
2041 with :
2142 java-version : ${{ inputs.java-version }}
2243 distribution : ${{ inputs.distribution }}
23- cache : ' maven'
44+
45+ - name : Cache local Maven repository
46+ uses : actions/cache@v2
47+ id : cache
48+ if : ${{ inputs.cache == 'true' }}
49+ with :
50+ path : ~/.m2/repository
51+ key : ${{ inputs.cache-name }}-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
52+ restore-keys : |
53+ ${{ inputs.cache-name }}-${{ runner.os }}-maven-
2454
2555 - name : Update maven dependencies
2656 working-directory : ${{ inputs.working-directory }}
27- run : ./mvnw --batch-mode --fail-fast dependency:resolve
57+ run : ./mvnw --batch-mode --fail-fast dependency:resolve dependency:resolve-plugins
2858 shell : bash
0 commit comments