Monthly Archives: June 2011

How to skip Maven unit test

By default, when you build your project with Maven, it will run the entire unit tests of your project.

$ mvn install

Or:

$ mvn package

However, if any of unit test is failed, it will force Maven to abort the building process. In real life, you may still need to build your project even unit test is failed.

To skip it, use -Dmaven.test.skip=true option to tell Maven that you want to skip running the entire unit test. For example,

$ mvn install -Dmaven.test.skip=true
$ mvn package -Dmaven.test.skip=true

Now, when you build your project build, all unit tests will be ignored.

[Seen: Mkyong]

By default, when you build your project with maven, it will run the entire unit tests of your project.

$ mvn install

Or:

$ mvn package

However, if any of unit test is failed, it will force Maven to abort the building process. In real life, you may “STILL” need to build your project even unit test is failed.

To skip it, use “-Dmaven.test.skip=true” option to tell Maven that you want to skip running the entire unit test. For example,

$ mvn install -Dmaven.test.skip=true
$ mvn package -Dmaven.test.skip=true

Now, when you build your project build, all unit tests will be ignored.

[Seen: Mkyong]