What are Maven goals and phases and what is their difference?

前端 未结 8 1268
时光说笑
时光说笑 2020-11-27 23:51

What is the difference/relation between Maven goals and phases? How they are related to each other?

8条回答
  •  佛祖请我去吃肉
    2020-11-28 00:29

    The chosen answer is great, but still I would like to add something small to the topic. An illustration.

    It clearly demonstrates how the different phases binded to different plugins and the goals that those plugins expose.

    So, let's examine a case of running something like mvn compile:

    • It's a phase which execute the compiler plugin with compile goal
    • Compiler plugin got different goals. For mvn compile it's mapped to a specific goal, the compile goal.
    • It's the same as running mvn compiler:compile

    Therefore, phase is made up of plugin goals.

    Link to the reference

提交回复
热议问题