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.
In more detail
Asking for package compiles, tests and then packages. Maven itself does little; plugins attach their goals to phases and do the work, which is why build output is full of plugin names. Skipping tests is a flag on the same command, not a different command.
Examples
./mvnw test./mvnw package -DskipTestsRelated terms
- Maven — A build tool for Java in which a project declares itself in a pom.xml file and is built by a fixed lifecycle of phases.
- plugin — An add-on that extends a tool with extra features, such as the Maven and Gradle plugins that compile, test and package Java code.
- -DskipTests — A Maven command-line property that builds and packages the project without running the tests.
- target directory — The folder where Maven writes everything a build produces: compiled classes, test reports and the packaged JAR.
Taught in
- The Toolchain: Maven — Modern Java: Virtual Threads & High-Throughput Services