1
votes

i got a Maven Jenkins Job (not a Pipeline job) which runs a code analysis with sonar (mvn sonar:sonar). The Sonar report is create and everthing is fine. Now I want that the Jenkins job fails or at least gets a warning state if Sonar does not reach the quality gate.

I running Jenkins ver. 2.176.3.

How do I config the job? I only found a solution for a pipeline job with SonarQube (https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins/)

Thanks ...

1

1 Answers

0
votes

Found a solution.

https://github.com/jenkinsci/sonar-quality-gates-plugin/blob/master/README.md

Just install the plugin and add as Post Build Step "Quality Gates SonarQube Plugin".