diff --git a/Jenkinsfile b/Jenkinsfile index bc034b5..0c8ac30 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,10 +45,25 @@ pipeline { } } + stage('Prepare OWASP cache') { + steps { + cache(caches: [[ + $class: 'ArbitraryFileCache', + path: "${env.WORKSPACE}/dependency-check-data", + includes: '**/*', + excludes: '' + ]]) { + 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"' + } + } + } + } + stage('Build and test') { steps { withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') { - sh 'mvn -B clean verify -Dbuild.revision="$GIT_COMMIT"' + sh 'mvn -B clean verify -DdataDirectory="$WORKSPACE/dependency-check-data" -Dbuild.revision="$GIT_COMMIT"' } } post {