How do you specify a string of goals as the defaultGoal in maven 2?

此生再无相见时 提交于 2019-12-05 15:12:26

There is something roughly equivalent, you CAN define a default goal or phase that will be executed if none is given in the build element:

<build>
  <defaultGoal>install</defaultGoal>
  ...
</build>

But this has to be a single phase, or goal, you can't pass multiple phases/goals (not really a problem since a phase triggers all preceding phases).

Here is what the POM Reference writes about defaultGoal:

defaultGoal: the default goal or phase to execute if none is given. If a goal is given, it should be defined as it is in the command line (such as jar:jar). The same goes for if a phase is defined (such as install).

Reference

No there is no such thing in Maven to define a default goal neither a target (which does not exist in Maven), cause you will call maven allways with a goal e.g. mvn clean or mvn package etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!