Skip to content

Commit 9a3c04c

Browse files
committed
update jenkinsfile
1 parent 5397e8f commit 9a3c04c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎Jenkinsfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ pipeline {
3838
steps {
3939
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
4040
withSonarQubeEnv('sonar') {
41-
sh "mvn -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
41+
sh "mvn -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
4242
}
4343
}
4444
timeout(time: 1, unit: 'HOURS') {
4545
waitForQualityGate abortPipeline: true
4646
}
4747
}
48+
}
4849

4950
stage ('build & push') {
5051
steps {

‎Jenkinsfile-online‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ pipeline {
3434
}
3535
}
3636

37+
stage('sonarqube analysis') {
38+
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"
42+
}
43+
}
44+
timeout(time: 1, unit: 'HOURS') {
45+
waitForQualityGate abortPipeline: true
46+
}
47+
}
48+
}
49+
3750
stage ('build & push') {
3851
steps {
3952
container ('maven') {

0 commit comments

Comments
 (0)