File tree Expand file tree Collapse file tree 4 files changed +41
-6
lines changed Expand file tree Collapse file tree 4 files changed +41
-6
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,22 @@ jobs:
1212 fetch-depth : 0
1313 persist-credentials : false
1414
15+ - name : Cache local Maven repository
16+ uses : actions/cache@v3
17+ with :
18+ path : ~/.m2/repository
19+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20+ restore-keys : |
21+ ${{ runner.os }}-maven-
22+
1523 - name : Set up JDK 21
1624 uses : oracle-actions/setup-java@v1
1725 with :
1826 website : jdk.java.net
1927 release : 21
20- - run : ./mvnw clean install -Pall-quality-gates -B
28+
29+ - name : Run Maven
30+ run : ./mvnw clean install -Pall-quality-gates -B
2131
2232 release :
2333 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1414 with :
1515 website : jdk.java.net
1616 release : 21
17- - run : ./mvnw clean versions:update-properties scm:check-local-modification -U -B
17+
18+ - name : Run Maven
19+ run : ./mvnw clean versions:update-properties scm:check-local-modification -U -B
Original file line number Diff line number Diff line change 99 steps :
1010 - uses : actions/checkout@v4
1111
12+ - name : Get Date
13+ id : get-date
14+ run : |
15+ echo "datetime=$(/bin/date -u "+%Y%m%d%H")" >> $GITHUB_OUTPUT
16+ shell : bash
17+
18+ - name : Restore cached Maven dependencies
19+ uses : actions/cache/restore@v3
20+ with :
21+ path : ~/.m2/repository
22+ # Using datetime in cache key as OWASP database may change, without the pom changing
23+ key : ${{ runner.os }}-maven-${{ steps.get-date.outputs.datetime }}-${{ hashFiles('**/pom.xml') }}
24+ restore-keys : |
25+ ${{ runner.os }}-maven-${{ steps.get-date.outputs.datetime }}
26+ ${{ runner.os }}-maven-
27+
1228 - name : Set up JDK 21
1329 uses : oracle-actions/setup-java@v1
1430 with :
1531 website : jdk.java.net
1632 release : 21
17- - run : ./mvnw clean install dependency-check:check -DnvdApiKey= -B
33+
34+ - name : Run Maven
35+ run : ./mvnw clean install dependency-check:check -DnvdApiKey=${{ secrets.NVD_API_KEY }} -DnvdApiDelay=6000 -B
36+
37+ # Want the Maven dependencies to be cached even if the build fails as we want the OWASP database cached, regardless of whether vulnerabilities are found or not
38+ - name : Cache Maven dependencies
39+ uses : actions/cache/save@v3
40+ if : always()
41+ with :
42+ path : ~/.m2/repository
43+ key : ${{ runner.os }}-maven-${{ steps.get-date.outputs.datetime }}-${{ hashFiles('**/pom.xml') }}
Original file line number Diff line number Diff line change 308308 <artifactId >dependency-check-maven</artifactId >
309309 <version >${dependency-check-maven.version} </version >
310310 <configuration >
311- <!-- NVD API Key obtained from https://nvd.nist.gov/developers/request-an-api-key -->
312- <nvdApiKey >${nvdApiKey} </nvdApiKey >
313-
314311 <!-- Assembly analyzer disabled because we don't have any .NET code/dlls -->
315312 <assemblyAnalyzerEnabled >false</assemblyAnalyzerEnabled >
316313 <!-- Node and retirejs analyzer disabled, because any js floating around isn't part of the main app -->
You can’t perform that action at this time.
0 commit comments