diff --git a/Jenkinsfile b/Jenkinsfile index 5184adf89..f623beea9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ pipeline { agent { label 'Master'} + triggers { pollSCM ('* * * * *') } stages{ stage('vcs') { steps { @@ -30,14 +31,7 @@ pipeline { ) } } - stage('Test the code by using sonarqube') { - steps { - withSonarQubeEnv('SONAR_CLOUD') { - sh 'mvn clean verify sonar:sonar -Dsonar.login=ea06c1ce5d1ee81e35db29d8cb0de69b42c70278 -Dsonar.organization=springpetclinic-1 -Dsonar.projectKey=springpetclinic-1_bha' - } - } - } - stage ('Exec Maven') { + stage ('package') { steps { rtMavenRun ( tool: 'MAVEN_DEFAULT', @@ -50,6 +44,13 @@ pipeline { ) } } + stage('Test the code by using sonarqube') { + steps { + withSonarQubeEnv('SONAR_CLOUD') { + sh 'mvn clean verify sonar:sonar -Dsonar.login=ea06c1ce5d1ee81e35db29d8cb0de69b42c70278 -Dsonar.organization=springpetclinic-1 -Dsonar.projectKey=springpetclinic-1_bha' + } + } + } stage('Gathering the artifacts & test results') { steps { archiveArtifacts artifacts: '**/target/*.jar',