File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,15 @@ pipeline {
3636
3737 stage(' sonarqube analysis' ) {
3838 steps {
39- withCredentials([string(credentialsId : ' sonar-token' , variable : ' SONAR_TOKEN' )]) {
40- withSonarQubeEnv(' sonar' ) {
41- sh " mvn -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN "
39+ container (' maven' ) {
40+ withCredentials([string(credentialsId : ' sonar-token' , variable : ' SONAR_TOKEN' )]) {
41+ withSonarQubeEnv(' sonar' ) {
42+ sh " mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN "
43+ }
44+ }
45+ timeout(time : 1 , unit : ' HOURS' ) {
46+ waitForQualityGate abortPipeline : true
4247 }
43- }
44- timeout(time : 1 , unit : ' HOURS' ) {
45- waitForQualityGate abortPipeline : true
4648 }
4749 }
4850 }
Original file line number Diff line number Diff line change @@ -36,14 +36,16 @@ pipeline {
3636
3737 stage('sonarqube analysis') {
3838 steps {
39- withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
40- withSonarQubeEnv('sonar') {
41- sh "mvn -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
39+ container ('maven') {
40+ withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
41+ withSonarQubeEnv('sonar') {
42+ sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
43+ }
4244 }
43- }
44- timeout(time: 1, unit: 'HOURS') {
45- waitForQualityGate abortPipeline: true
46- }
45+ timeout(time: 1, unit: 'HOURS') {
46+ waitForQualityGate abortPipeline: true
47+ }
48+ }
4749 }
4850 }
4951
Original file line number Diff line number Diff line change 3030 <id >sonar</id >
3131 <activation >
3232 <activeByDefault >true</activeByDefault >
33- </activation >
33+ </activation >
3434 </profile >
3535 </profiles >
3636 <mirrors >
You can’t perform that action at this time.
0 commit comments