Build Maven Project Without Running Unit Tests

Federer picture Federer · Oct 22, 2009 · Viewed 142.8k times · Source

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 tests 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?

Answer

alphazero picture alphazero · Oct 22, 2009

If you want to skip running and compiling tests:

mvn -Dmaven.test.skip=true install

If you want to compile but not run tests:

mvn install -DskipTests