Monday, October 01, 2007

Quicker Maven Builds

A simple tip. Maven builds quickly get slow, as more and more unit tests are added. Often, when developing, I do "maven -Dmaven.test.skip=true", until I think I am ready. I then do a build with tests and if okay, I commit.

Only thing is, typing "-Dmaven.test.skip=true" is long and tiring. But, you can shorten it down a bit. Add this to the profiles section of your settings.xml:

<profile>
<id>quick</id>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>

Then, when you want to build without tests, you simply do "mvn -Pquick".

You can also do a little script or alias for quick building with maven, as I have previously written about.

3 comments:

ambro said...

You can also skip tests by modifying the pom.xm. For more information, refer to: lhttp://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-test.html

ambro said...
This comment has been removed by the author.
ambro said...
This comment has been removed by the author.