如何在一个阶段中执行几个Maven插件并设置它们各自的执行顺序? [英] How can I execute several maven plugins within a single phase and set their respective execution order?

查看:947
本文介绍了如何在一个阶段中执行几个Maven插件并设置它们各自的执行顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Maven生命周期中的某些阶段分解为子阶段.我想控制从一个子阶段到另一子阶段的执行流程,有点像具有蚂蚁依赖项.

I would like to breakup certain phases in the maven life cycle into sub phases. I would like to control the execution flow from one sub-phase to another, sort of like with ant dependencies.

例如,我想使用NSIS插件在打包阶段将我的项目打包到安装程序中,之后,我的项目已打包到war文件中.我想在打包阶段做所有的事情.

For example, I would like to use the NSIS plugin in order to package up my project into an installer at the package stage, AFTER my project had been packaged into a war file. I would like to do all that at the package phase.

有可能吗?

推荐答案

绑定到同一阶段的插件应该以与POM中列出的顺序相同的顺序执行.在某些情况下(例如,如果您将同一个插件两次绑定到一个阶段,例如antrun插件),则可能不会发生,但这是一个错误(请参见 MNG- 3719 ).

Plugins bound to the same phase should be executed in the same order as they are listed in the POM. Under certain circumstances (e.g. if you bind the same plugin to a phase twice, like the antrun plugin), this may not occur but this is a bug (see MNG-2258 and the related issue MNG-3719).

这篇关于如何在一个阶段中执行几个Maven插件并设置它们各自的执行顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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