Maven builds often take some time. This often causes me to start doing something else (read mail, browse web), which makes me unaware of when the build completes and I can continue working.
There should be a way to fix this. On Ubuntu, you get notifications when mail arrives, when network is up/down etc. Why not use this same system to get notifications when the maven build completes.
You can do this by adding the following in your ~/.bash_aliases file:
alias maven="command mvn" notified_maven() { maven $* ; notify-send --icon=message-im "mvn" "build finished" } alias mvn=notified_maven |
Update
Thanks to Adrien, you can also use a more advanced version, showing the build result and maven parameters.
alias maven="command mvn" notified_maven() { maven $* | \ perl -pe'$m|=/BUILD .*SUCCESS/; END {exit!$m}' && \ notify-send --icon=face-cool "`basename $(pwd)`: mvn $*" "Build SUCCESS" || \ notify-send --icon=face-crying "`basename $(pwd)`: mvn $*" "Build FAILED" } alias mvn=notified_maven |
