如何调用Maven默认生命周期 [英] How to invoke maven default lifecycle

查看:119
本文介绍了如何调用Maven默认生命周期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我打电话

mvn clean install

maven知道clean是生命周期,而install是默认生命周期的一个阶段

maven knows that clean is a lifecycle and install is a phase of the default lifecycle

如果我打电话

mvn deploy

maven将顺序执行默认生命周期的所有阶段.

maven will execute all phases of the default lifecycle sequentially.

是否可以通过提供生命周期名称(而不是执行生命周期的最后一个相位)来调用默认生命周期?

Is there a way to call the default lifecycle by giving a lifecyle name (instead of executing the last phsae of the lifecycle)?

所以问题是:是否有命令

So the question is: is there a command

mvn lifecyclename

开始执行默认生命周期?

that start execution of the default lifecycle?

推荐答案

似乎存在误解.进一步阅读可以澄清这一点

There seems to be a misunderstanding. Further reading could clarify that

mvn clean

不会调用整个干净的生命周期.实际上,在干净的生命周期中有一个干净的阶段.然后该命令执行此阶段,而不是生命周期.

does not invoke the whole clean lifecycle. In fact there is a clean phase in the clean lifecycle. And the command executes this phase and not the lifecycle.

这篇关于如何调用Maven默认生命周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆