Thursday, January 08, 2009

Skipping Maven Tests ... For real!

For the longest time, I have been trying to figure out how to skip running
the tests that are in a project that I have been working on because they
usually fail!

Usually, I edit the POM file and disable testing, but with a project
containing numerous subprojects, this became very tedious.

All of the documentation points to a variable maven.test.skip and states to
set it to true in order to skip tests; something like:

maven.test.skip=true

This has never worked for me. In case you are wondering, I am using maven
2.0.9 (latest as of January 8, 2009)

Having tried everything, I finally have found a way to get it to work
properly:

maven.test.skip.exec=true

Now when I run the install task for the project, I do it like:

mvn -Dmaven.test.skip.exec=true install

Tests are finally skipped!