Maven voice notifications on Mac OS X
April 16th, 2009
A quick hack to get the ‘mvn’ Maven script to vocally notify ‘Success’ or ‘Failed’ when the build completes. I find it useful as it grabs my attention when I’m undertaking other tasks while the build is churning.
Naturally the real solution is getting the build to run in seconds… Technical debt, thou art a harsh mistress.
Replace the last couple of lines (starting with ‘exec’) in your mvn script with:
"$JAVACMD"
$MAVEN_OPTS
-classpath "${M2_HOME}"/boot/classworlds-*.jar
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf"
"-Dmaven.home=${M2_HOME}"
${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS && say "Success!" || (say "Failed!" && false)
Updated: Changed to avoid incorrectly returning a successful exit code on failure.







