Search code examples
gradlesonarqube

Fail Gradle Build for Sonar Violations


How do I configure my Gradle build to fail when there are Sonar violations?

I want my Gradle build to fail if there are any are any critical or blocker violations in Sonar, is this functionality supported? If so, is it documented anywhere?


Solution

  • It's not something that can be configured on the build side. Instead, the "build breaker plugin" has to be configured on the Sonar side. I'm not completely sure if it works with Gradle, but I think it does.