Take the 2-minute tour ×

How do you build a Maven project without running unit tests?

Currently restructuring some code I have for a Servlet and would like to try it out in my web browser (which means running mvn install to get the .war to upload to Tomcat). I'm fully aware my UNIT test are failing and I'm fine with that because I will fix it once I have the code the way I want. Can anyone advise?

share|improve this question

2 Answers 2

up vote 162 down vote accepted
mvn -Dmaven.test.skip=true install
share|improve this answer
This commend will skip running and compiling tests. If you want to compile but not run tests use -DskipTests –  cetnar Oct 22 '09 at 17:48
In the case of tomcat: tomcat:deploy -DskipTests –  chelder May 22 '13 at 23:13

If you are using eclipse there is a "Skip Tests" checkbox on the configuration page.

Run configurations->
Maven Build->
Main tab->
Skip Tests checkbox
share|improve this answer

Your Answer


