gpt4 book ai didi

maven-2 - 你如何强制maven执行antrun :run task after all the package tasks in a POM with child modules?

转载 作者:行者123 更新时间:2023-12-04 06:27:58 26 4
gpt4 key购买 nike

我有一个带有一堆子模块的父 POM。
我想在所有 child 都执行了打包任务之后运行 antrun:run 任务(我正在使用 Ant 打包我的应用程序,因为我放弃了弄清楚如何让程序集正常工作)。

我需要在所有 child 之后执行 antrun 任务 - 但我不能将它与包阶段相关联,因为 parent 在 child 之前被“打包”,我需要 ant 之后运行。

有没有办法在一个命令中做到这一点?

当然,简单的解决方法是运行 2 个 maven 命令:

mvn package; mvn antrun:run

但如果可能的话,我想一次性完成
mvn package antrun:run

产生错误的行为 - 它在子项目的打包阶段之前运行 antrun:run。

理想情况下,我可以只输入
mvn package

并在所有子节点上运行包阶段,然后在父节点上运行 antrun:run。

最佳答案

I need to have the antrun task execute after all the children - but I can't associate it with package phase since parent gets "packaged" before children, and i need ant to run afterwards.



创建另一个模块 取决于 所有 child (因此它将是 react 堆构建期间的最后一个项目)并将您的 antrun 东西绑定(bind)到 package在这个模块中。然后运行 ​​ mvn package从根项目。

关于maven-2 - 你如何强制maven执行antrun :run task after all the package tasks in a POM with child modules?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3375574/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com