Skip to content
Jean-Christophe GAY edited this page Mar 30, 2019 · 23 revisions

maven-notifier

A collection of notifiers for Maven 3.x.

Configuration

If needed, configuration can be done by creating a maven-notifier.properties file in your ~/.m2 folder and using keys:

  • notifier.implementation = which implementation to use. (growl, notificationcenter, simplenc, notifysend, systemtray, snarl, pushbullet, kdialog, notifu, anybar, toaster, notify, burnttoast, slack, donothing).
  • notifier.message.short = true/false. Choose between a full description with each module summary or a short one just reflecting the build status. (true by default)
  • notifier.threshold = a time in second under which a build will not fire a notification. (-1 by default meaning a notification will always be sent). If set to 10 for example, no notification will be triggered if the build ends before 10s.
  • notifier.timeout = a timeout in milliseconds set to not wait for a notifier too long. (-1 by default meaning we will wait 'indefinitely' for the notifier to be initialized).

Notification can be skipped when launching Maven.

mvn package -DskipNotification

The implementation can be override at runtime.

mvn package -DnotifyWith=growl    

Default notifiers

maven-notifier will try to find an available notifier on running os.

OS X:

  • Growl,
  • Notification Center (with terminal-notifier)
  • System Tray

Linux:

  • Kdialog,
  • notify-send,
  • System Tray

Windows:

  • Snarl,
  • Growl,
  • Toaster,
  • BurntToast,
  • System Tray

Disable notification

If for some reason you want to entirely disable notifications, you have two choices:

  • Add <skipNotification>true</skipNotification> in the properties of your settings.xml
  • Set notifier.implementation=donothing in ~/.m2/maven-notifier.properties

Use multiple notifiers

You can choose to send notification to multiple notifiers at once using:

notifier.implementation=growl,pushbullet

In this case, growl will always be used and pushbullet can be activated when passing property notifyAll to the JVM.

mvn test -DnotifyAll

It is handy when you launch a long build and know that you may not be in front your computer anymore when the build should ends.

Notifiers Configuration