New Location

My website has moved to http://www.jasonwhaley.com. Please visit there for the latest and only remain here for legacy content.

Wednesday, February 25, 2009

Growl Maven Integration

Well, not really. I am copying and pasting something directly from Lars Trieloff that shows a bash script that wraps the mvn executable, pipes its output to awk, and sends selective notices to growl. You will need to have the growlnotify exectuable installed to use this.

#! /bin/sh
/usr/share/maven/bin/mvn $* | awk '
{
print;
if($0 ~ ".*ERROR.*") system("/usr/local/bin/growlnotify -n mavenError -t Maven Error -m\""$0 "\"")
if($0 ~ ".*BUILD SUCCESSFUL.*") system("/usr/local/bin/growlnotify -n mavenComplete -t Maven FTW! -m\""$0 "\"")
}
END {
}'

Pretty neat.

0 comments: