-DskipTests
A Maven command-line property that builds and packages the project without running the tests.
In more detail
-D sets a property for the build, and the Surefire plugin reads skipTests. The course uses it when packaging inside a container because the tests have already run earlier in the pipeline. Using it to hide failing tests defeats the point of having them.
Example
./mvnw -B -ntp package -DskipTestsRelated terms
- Maven Surefire Plugin — The Maven plugin that runs unit tests during the test phase and writes their reports to target/surefire-reports.
- Maven build lifecycle — Maven's fixed, ordered list of phases, validate, compile, test, package, verify, install and deploy, where asking for one runs all before it.
Taught in
- The Toolchain: Maven — Modern Java: Virtual Threads & High-Throughput Services
- Packaging Into A Container — Modern Java: Virtual Threads & High-Throughput Services