Skipping Junit Tests in maven build


When a project is build, Maven runs all the junit tests written for this project by default. But sometime few of them gets failed. But still developer wants to build the project.

For this purpose junit tests can be skipped with -DskipTests command on command line as below.

D:\Project>mvn install -DskipTests

Or -Dmaven.test.skip=true can be used as below on command line.

D:\Project>mvn install -Dmaven.test.skip=true

The difference in both the commands is that skipTests complies the tests and skips running. While maven.test.skip stops both compile and run.

Comments

Popular posts from this blog

Writing text to file and reading text from files in Java

Java Program for Anagrams