Maven Lifecycle Phases - Fitting in Code Analysis and Other Tools
The build management portion of Maven operates on a type of Template Pattern. Maven moves from lifecycle-phase to lifecycle-phase until there a step failure or until all steps are complete. The following diagram lists the build lifecycle phases. The orange squares represent the main targets that people run. Every phase is executed starting with Validate until the requested end phase is reached. For example "mvn validate" runs just the Validate phase. " mvn compile" runs Validate, Initialize, Generate Sources, Process Sources, Generate Resources, Process Resources and Compile. Each Maven Plugin executes with in a phase. The Surefire unit test plugin, as an example, typically runs the tests in the Test phase. This means that unit tests don't run if Validation, Compilation, class processing or any of the other preceding phases run with errors. Maven plugins can execute in their default phase or in any phase of your choosing. Lifecy...