A toolbox in Java
to send notifications.
Example with Maven:
<dependencies>
[...]
<dependency>
<groupId>fr.jcgay.send-notification</groupId>
<artifactId>send-notification</artifactId>
<version>0.16.0</version>
</dependency>
[...]
</dependencies>
Get a notifier:
Notifier notifier = new SendNotification()
.setApplication(application)
.initNotifier();
The application
is not mandatory, you'll get a default one if it's not set.
Then send notification:
try {
notifier.send(notification);
} finally {
notifier.close;
}
Download bundle, extract it, add the bin
directory to your $PATH
.
For OS X users, you can use a brew formula here.
> send-notification -h
Usage: <main class> [options] notifier(s)
Options:
-h, --help
show help
Default: false
* -i, --icon
notification icon
-l, --level
notification level (INFO, WARNING, ERROR)
* -m, --message
notification message
-s, --subtitle
notification subtitle
* -t, --title
notification title
-v, --version
show version
Default: false
(*) are mandatory parameters.
Example:
send-notification notifysend -m "Build success !" -t "maven-notifier" -i "success.png"
Go to Wiki to read full configuration guide for each notifier.
Notifier | Screenshot |
---|---|
Growl, for Windows and OS X. | |
Snarl, for Windows | |
terminal-notifier, OS X | |
notification center OS X (since Mavericks) | |
notify-send for Linux | |
SystemTray since Java 6 | |
Pushbullet | |
Kdialog for KDE | |
notifu for Windows | |
AnyBar for OS X and Linux | |
Toaster for Windows 8 | |
Notify since Java 6 | |
BurntToast for Windows 10 (NB must be enabled manually) | |
Slack |
You will need Maven and a JDK 8. If your default JDK is higher than 8, Maven will use a configured toolchains.
mvn verify
Multiple VMs are available in vm for Windows, Linux and macOS to integrate with the various notifiers.
mvn -B release:prepare release:perform