diff --git a/Jenkinsfile b/Jenkinsfile index 0c8ac30..7f442a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,14 +47,10 @@ pipeline { stage('Prepare OWASP cache') { steps { - cache(caches: [[ - $class: 'ArbitraryFileCache', - path: "${env.WORKSPACE}/dependency-check-data", - includes: '**/*', - excludes: '' - ]]) { + lock(resource: 'owasp-nvd-cache') { withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') { - sh 'mvn -B org.owasp:dependency-check-maven:13.0.0:update-only -DdataDirectory="$WORKSPACE/dependency-check-data"' + sh 'mkdir -p "$HOME/.cache/dependency-check"' + sh 'mvn -B org.owasp:dependency-check-maven:13.0.0:update-only -DdataDirectory="$HOME/.cache/dependency-check"' } } } @@ -63,7 +59,7 @@ pipeline { stage('Build and test') { steps { withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') { - sh 'mvn -B clean verify -DdataDirectory="$WORKSPACE/dependency-check-data" -Dbuild.revision="$GIT_COMMIT"' + sh 'mvn -B clean verify -DdataDirectory="$HOME/.cache/dependency-check" -DautoUpdate=false -Dbuild.revision="$GIT_COMMIT"' } } post {