woensdag 9 januari 2008

Maven1 and a Mac

Ever had that icons keep popping up in your dock when you're running java stuff on your Mac. I know I had that problem. The trouble is that these apps steal your focus away from the applications you're working with.

During a Maven build with forked JUnit tests, this is especially problematic, as the focus keeps switching. Normally you solve this, by specifying the command line switch

-Djava.awt.headless=true

However when forking JUnit tests, this doesn't work. The trick is that not all switches are passed into the newly forked processes. However if you put the following in your build.properties, these will be passed, and you're one step closer to living a pain-free life with your Mac...

file: build.properties
java.awt.headless=true
maven.junit.sysproperties=java.awt.headless