Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) → 9.9
- how is SonarQube deployed: zip, Docker, Helm → zip
- what are you trying to achieve → Sonar scan report
- what have you tried so far to achieve this → I created the Jenkins pipeline for this and integrated the sonar.
ANALYSIS SUCCESSFUL but giving 401 while fetching Quality Gate status.
I am using User type token with sonar-users group permission.
jenkins pipeline
Sonar stage in jenkins pipeline:
stage('Build and Test') {
withSonarQubeEnv(installationName: 'sonar-server') {
configFileProvider([configFile(fileId: 'MAVEN_SETTINGS_NEW', variable: 'MAVEN_SETTINGS_NEW')]) {
sh "mvn -s ${MAVEN_SETTINGS_NEW} clean org.jacoco:jacoco-maven-plugin:0.8.10:report install sonar:sonar"
}
}
}
stage("Quality Gate") {
timeout(time: 3, unit: 'MINUTES') {
sleep(40)
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
Quality gate stage is failing with 401
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!