From 48933222a6adcf8928b4eefbcd84e20a15b498dc Mon Sep 17 00:00:00 2001 From: Benjamin Stein Date: Mon, 8 May 2017 19:50:08 -0700 Subject: [PATCH] use jenkins file with the nexus id for credentals provider --- Jenkinsfile | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dccb03d07..c27def07f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,17 @@ pipeline { agent { docker { - image 'maven:3-alpine' + image 'maven:3.5.0' + args '-v /usr/share/jenkins/ref/.m2/:/root/.m2/ --network=plumbing_default' } } stages { stage ('Build') { steps { - git branch: 'master', url: 'https://github.com/liatrio/spring-petclinic.git' - sh 'mvn deploy' - } - } - stage ('Sonar Analysis') { - steps { - script { - scannerHome = tool 'Sonar' - } - - withSonarQubeEnv('Sonar') { - sh "${scannerHome}/bin/sonar-scanner" - } + configFileProvider( + [configFile(fileId: 'nexus', variable: 'MAVEN_SETTINGS')]) { + sh 'mvn -s $MAVEN_SETTINGS clean deploy -DskipTests=true' + } } } }