Skipping tests during Maven phases

If you’re running a Maven phase/goal and need to skip the execution of tests (because they’re temporarily failing), add one of the following options:

mvn -DskipTests phasename
mvn -Dmaven.test.skip=true phasename

Normally you’d only continue with the build if the tests are passing, but sometimes you may have a valid reason to force the build to continue regardless.

These options are covered in the Maven docs here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.