When you run the mvn package command, as part of the build cycle, Maven will compile and test the code before packaging it in its distributable format.

However there are times when you want to compile and package the code without running the test. While I don’t advocate shipping untested code, there can be a number of reasons why you want to package the code without running test.

In order to perform mvn package without running the test. You need to use the argument -Dmaven.test.skip=true

So the command should look like the following

mvn package -Dmaven.test.skip=true

Edwin Kwan is the founder and editor of Little Handy Tips and Wollongong Fitness. He is also the developer for the Google Custom Search WordPress plugin and Custom About Author WordPress plugin. He also has a keen interest in Photography . Find out more about him here.

Google+