Maven为appengine构建生命周期:更新 [英] maven build lifecycle for appengine:update

查看:162
本文介绍了Maven为appengine构建生命周期:更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Maven Java项目上运行 mvn appengine:update 时,除了部署Google App Engine应用程序之外,还执行Maven构建生命周期中的其他目标。例如,运行 mvn appengine:update 会分离 copy-resources compile <

我并不是说这肯定是一件坏事,但我真的有兴趣了解其他Maven目标是如何以及为什么是执行。 appengine:update 的设置是否使这些其他目标运行?如何覆盖它?



参考: 谷歌的GAE Maven插件

解决方案

正在运行 appengine:update


>>> appengine-maven-plugin:1.8 .1:update(default-cli)@ mvn >>>


当你看到一个目标运行开始于>>> (而不是---),一个分支实际上已经开始。 Maven中的分叉由mojo中的 @execute 注释控制。在这里查看更多详情: http:// books。 sonatype.com/mvnref-book/reference/writing-plugins-sect-plugins-lifecycle.html



其他目标已经开始的原因是因为Update mojo提到它需要一切,直到阶段: https://code.google.com/p/appengine-maven-plugin/source/browse /src/main/java/com/google/appengine/appcfg/Update.java



我不确定是否可以覆盖它,但在实践中,我认为你不应该重写它。 @execute 注释用于定义先决条件目标。这是由开发人员的设计。如果你跳过它,可能会出错。


When I run mvn appengine:update on my Maven Java project, other goals from the Maven build lifecycle are executed in addition to just deploying a Google App Engine app. For example, running mvn appengine:update will spin off copy-resources and compile goals automatically.

I am not saying that this is necessarily a bad thing, but I am really interested in understanding how and why the other Maven goals are executed. What are the settings for appengine:update that makes these other goals run? How can I override it?

Reference: Google's Maven plugin for GAE

解决方案

Notice the message when you are running appengine:update

>>> appengine-maven-plugin:1.8.1:update (default-cli) @ mvn >>>

When you see that a goal running is started with >>> (instead of ---), a fork has actually started. Forking in maven is controlled by the @execute annotation in the mojo. See more details here: http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-plugins-lifecycle.html

The reason why the other goals has been started is because the Update mojo mentions that it needs everything up to the package phase: https://code.google.com/p/appengine-maven-plugin/source/browse/src/main/java/com/google/appengine/appcfg/Update.java.

I'm not sure whether it is possible to override it, but in the practice, I think you should not override it. The @execute annotation is used to define the prerequisite goals. It is by the developer's design. Something might go wrong if you skip it.

这篇关于Maven为appengine构建生命周期:更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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