https://github.com/webcerebrium/java-slack-notification
Simple library for sending notifications to Slack
https://github.com/webcerebrium/java-slack-notification
Last synced: 6 months ago
JSON representation
Simple library for sending notifications to Slack
- Host: GitHub
- URL: https://github.com/webcerebrium/java-slack-notification
- Owner: webcerebrium
- License: mit
- Created: 2017-10-26T16:30:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-09T16:17:57.000Z (over 8 years ago)
- Last Synced: 2024-04-16T09:21:53.988Z (about 2 years ago)
- Language: Java
- Size: 7.81 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack Notification
This library can be used to send Notification to the slack channel using Incoming URL hooks like this
```https://hooks.slack.com/services/T00000000/B0000000/HGBHWuJLDoJYtecT58hszOdt```
## Getting Started
#### with Maven
Add the following Maven dependency to your project's `pom.xml`:
```
com.webcerebrium
slack-notification
0.1.1
```
#### with Gradle
```
compile group: 'com.webcerebrium', name: 'slack-notification', version: '0.1.1'
```
#### with Grapes
```
@Grapes([
@Grab(group = 'com.webcerebrium', module = 'slack-notification', version = '0.1.1')
])
```
### with latest source code
After `git clone`, please run `gradle jar`, which will result in having jar under `build/distribution` folder.
compilation you will have jar in your folder, which could be included as your dependency like this:
```
dependencies {
compile files('libs/slack-notification-0.1.1.jar')
}
```
## Example of Application
```
import com.webcerebrium.slack.Notification;
SlackMessage message = new SlackMessage();
SlackMessageAttachment attach = new SlackMessageAttachment("Something saved", "Some body", "#c0FFF0");
attach.addMarkdown(ImmutableSet.of("title", "text"));
message.getAttachments().add(attach);
(new Notification()).send(message);
```
# License
MIT. Anyone can copy, change, derive further work from this repository without any restrictions.