Skip to content

Instantly share code, notes, and snippets.

@iocanel
Last active June 6, 2017 12:17
Show Gist options
  • Save iocanel/d64e6fdfb5c3a7e48ac641b18e6a6fe5 to your computer and use it in GitHub Desktop.
Save iocanel/d64e6fdfb5c3a7e48ac641b18e6a6fe5 to your computer and use it in GitHub Desktop.
An mvn wrapper that sends a notification when the build is done
#!/bin/bash
# An mvn wrapper that sends a notification when the build is done.
# Just throw it under $HOME/bin and create and alias:
# alias mvn=$HOME/bin/mvnnotify
#
# Requires notify-send or something similar.
MVN=`which mvn --skip-alias`
eval $MVN $*
RESULT = $?
#Don't report anything if its an `mvn -verison`
if [ "$1" == "-version" ];then
return $RESULT
fi
if [ $RESULT == 0 ]; then
notify-send -a "Maven" "Build Succeeded"
else
notify-send -a "Maven" "Build Failed"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment