How Maven executes
1. Build in phases,
for example:
mvn clean
mvn compile
mvn test
mvn package
indicates that maven will execute to a certain phase of a certain life cycle (phase),
this phase and all the goals (goals) bound to the previous phase will be executed, Each phase will bind maven's default goal or no goal, or a custom goal.
You can also skip certain phases by passing in parameters, for example:
1. Building
this type of goal with a goal is a goal without a bound phase, but this type of goal usually has an execution premise, that is, the project must be executed to a certain phase,
then executing this goal will actually trigger maven to execute the premise requirements. phase.
For example, jetty:run is a non-binding phase goal, and its premise is test-compile, which is formulated by the code logic of the plugin
two. Maven lifecycle, phase overview
Maven presets three Lifecycles, each of which includes the following Phases.
- Clean Lifecycle
- pre-clean
- clean
- post-clean
- Default Lifecycle
- validate
- initialize
- generate-sources
- process-sources
- generate-resources
- process-resources
- compile
- process-classes
- generate-test-sources
- process-test-sources
- process-test-resources
- test-compile
- process-test-classes
- test
- prepare-package
- package
- pre-integration-test
- integration-test
- post-integration-test
- verify
- install
- deploy
- Site Lifecycle
- pre-site
- site
- post-site
- site-deploy