I'm having a tough time seeing the "forest through the trees" on some Maven concepts here. I understand that Maven comes preconfigured with a slew of so-called "Build Lifecycle Phases" that begin with validate
, and test
and end with deploy
.
I am coming to Maven from Ant where you organized major build stages into targets (which can depend on other targets in a linear fashion), and then you decompose your targets into procedural tasks. Maven seems to supports this but in the form of goals.
My question (since I am used to thinking of building in terms of targets and tasks) is: how do these lifecycle phases (package
, verify
, etc.) relate to goals? Does one need to configured which goals to run at which phase, or is this done by Maven automagically somehow?
Or, do the goals come predefined with which phase they belong in?
I'm just not seeing how one orders goals to create a custom build that works for them or their organization.
Thanks in advance for any clarity!