6

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?

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137

1 Answers1

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