Send emails from jenkins if sonar finds an error

1,620 views
Skip to first unread message

niraj kumar

unread,
May 31, 2016, 12:54:10 PM5/31/16
to SonarQube
Hi,


How do someone trigger and email when sonar finds an error while scanning a repository(maven). The reason i am saying here is that we want to integrate this with our build pipeline so whenever a developer commits a code and the sonar does a scan of this build, it should actually throw a pass or fail email based on what sonar found. While doing a scan on linux console with sonar-scanner or mvn clean verify sonar:sonar  , the output just ends up in BUILD success and then you go to the UI and find out the remaining bugs sonar found.


Please help!!



--
Niraj

G. Ann Campbell

unread,
May 31, 2016, 2:01:55 PM5/31/16
to SonarQube
Hi Niraj,

It sounds like you're describing the functionality of the Build Breaker plugin. This is an option, but not one we recommend because by turning an asynchronous job (analysis report processing) into a synchronous one, you tie up a Jenkins executor for an indeterminate amount of time depending on the load on your SQ server.

Instead, we recomment preventing the Leak by using SonarLint in your IDE, and then pull request analysis before new code is merged.

If at that point you've still got new issues, you can receive email notifications of them directly from the SonarQube server itself.


HTH,
Ann
Reply all
Reply to author
Forward
0 new messages