在 Maven 中链接 mojo
我正在使用 Maven Cargo 插件在 Tomcat 中远程部署 Servlet。当我更新代码时,我必须运行两个 mojo,一个用于编译新的战争(package
),另一个用于远程部署战争(cargo:deployer-redeploy
) >)。
我希望能够简单地调用 cargo:deployer-redeploy
,它会调用源代码的编译和新战争的创建并远程部署。本质上,我希望重新部署 mojo 依赖于包 mojo(在 ant 术语中)。
I'm using the maven cargo plugin to remotely deploy a servlet in tomcat. When I make updates to the code I have to run two mojos, one for compiling a new war (package
), and one for deploying the war remotely (cargo:deployer-redeploy
).
I want to be able to simply invoke cargo:deployer-redeploy
and it invokes the compilation of the source code and creation of a new war and deploys that remotely. Essentially I want the redeploy mojo to be dependant on the package mojo (in ant
terminology).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将货物插件绑定到
package
之后的阶段(例如verify
),因此在 pom 的插件配置部分中,输入如下内容:当您运行 < code>mvn verify 它将运行 war 插件(作为
package
的一部分),然后运行 Cargo。You can just bind the cargo plugin to a later phase than
package
(e.g.verify
), so in the plugin's configuration section in the pom, put something like:When you run
mvn verify
it will run the war plugin (as part ofpackage
) then cargo.