Is there a way to configure Sonar or the Sonar Maven plugin to make a build fail when a violation of a certain priority (Blocker, Critical) is detected?
Asked
Active
Viewed 3,813 times
1 Answers
9
you have to define alert thresholds on the number of blocker/critical violations (>0 is your case) in quality profile and install the build breaker plugin (category "Integration" in Update Center of sonar 2.4).

Simon Brandhof
- 5,137
- 1
- 21
- 28
-
This is a good solution, but requires root access to sonar server and affects all projects. A less intrusive solution would be to execute a curl statement against sonars quality gate health endpoint, e.g. http://yoursonarserver:9000/api/qualitygates/project_status?projectKey=yourProjectKey – Fritz Duchardt Jan 09 '17 at 11:01