When executing a goal that will include the testing phase (such as package), you can do two things:
- Use the command
mvn -DskipTests=true package
. This will compile all
tests but not run them.
- Or
mvn -Dmaven.test.skip=true package
. This will not compile or run the test branch.