Skip to content

Commit f1aec2d

Browse files
author
runzexia
authored
Update Jenkinsfile
1 parent 6a17ef8 commit f1aec2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Jenkinsfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ pipeline {
3838
stage('sonarqube analysis') {
3939
steps {
4040
container ('maven') {
41-
withSonarQubeEnv('sonar') {
42-
sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.login=$SONAR_TOKEN_ID"
41+
withCredentials([string(credentialsId: "$SONAR_TOKEN_ID", variable: 'SONAR_TOKEN')]) {
42+
withSonarQubeEnv('sonar') {
43+
sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.login=$SONAR_TOKEN_ID"
44+
}
4345
}
4446
timeout(time: 1, unit: 'HOURS') {
4547
waitForQualityGate abortPipeline: true

0 commit comments

Comments
 (0)