- Sonarqube Developer Edition 7.9.1
- Jenkins 2.204.2
- SonarQube Scanner for Jenkins 2.11
- Sonarqube Scanner 220.127.116.113
We have a jenkins job which runs “Execute SonarQube Scanner”. We pass the git branch name via Analysis Property ‘sonar.branch.name’.
The Scanner and Sonarqube server both display the correct result of the scan as well as the Quality Gate status specific to the branch.
The Jenkins job also displays the Quality Gate status for the specified branch.
Is there a way for the Scanner to fail the build based on the Quality Gate status?
What I’ve tried:
I’ve tried using the Sonar Quality Gates 1.3.1 plugin but it’s over two years stale and didn’t account for the specified branch.
The Scanner plugin seems to know the correct quality gate status for the branch.
Is there a command line option or analysis property which could direct it to fail the build if the quality gate fails?