Monday, June 30, 2008

Skip Tests in Maven [Tip]

If your tests are failing and you can't be bothered to fix them, this handy tip will show you how you can skip tests and build your Maven project straightaway!

Simply add the property -Dmaven.test.skip=true to your Maven command. Here is an example:

mvn -Dmaven.test.skip=true install

The compiler will not compile the test sources and will not run your JUnit tests:

[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.

But of course, your test classes should always run, right?

Reference:
http://maven.apache.org/general.html

2 comments:

  1. Anonymous4:29 PM

    Thanks! Nice tip!

    ReplyDelete
  2. Anonymous9:33 AM

    I like play online game, I also buy hero gold and hero gold, the hero online gold is very cheap, and use the hero online money can buy many things, I like hero money, thanks, it is very good.

    I like play online game, I also buy kal geons and kal gold, the kal online geons is very cheap, and use the kal online gold can buy many things, I like kalonline Geons, thanks, it is very good.

    ReplyDelete