SonarQube plugin for sending notifications to Slack
This plugin sends a Slack message of project analysis outcome to congired project specific slack channel. The plugin uses Incoming Web Hook as the integration mechanism with Slack.
The plugin must be placed in SONAR_HOME/extensions/plugins directory and SonarQube must be restarted.
You can find the latest release from https://github.com/kogitant/sonar-slack-notifier-plugin/releases/ page. Download the
To build the plugin simply run
mvn clean package
After the plugin has been installed, you need to configure it. Although SonarQube offers project level configurations for some plugins, they cannot be used with this plugin because it runs in the "server side", and only sees the global settings.
As administrator, go to the general settings and configure the Sonar instance URL:
A new category Slack appears in the left menu:
Under it you can find the CKS Slack Notifier plugin configurations:
In the above example there is a Project Key to Slack Channel configuration for an example project. The project key of any SonarQube project can be found in the project page (bottom right corner):
The project key supports wildcards at the end. See #2
Notifications can be sent for all Quality Gate statuses, or just for WARNING/ERROR statuses. See #1
- Tested with SonarQube 6.1 against Slack on 2016.10.17
- Tested with SonarQube 6.1 against Mattermost 3.5.0 on 2017.01.02
- https://github.com/astrebel/sonar-slack-notifier-plugin
- https://github.com/dbac2002/sonar-hipchat-plugin
- http://docs.sonarqube.org/display/DEV/Adding+Hooks
- http://docs.sonarqube.org/display/DEV/Build+plugin
- https://api.slack.com/custom-integrations
- https://api.slack.com/docs/attachments#message_formatting
- https://api.slack.com/docs/attachments
mvn clean jacoco:prepare-agent install -DskipITs=true
mvn jacoco:prepare-agent-integration failsafe:integration-test
mvn sonar-maven-plugin:sonar -Dsonar.host.url=http://localhost:9000