maven build lifecycle for appengine:update

白昼怎懂夜的黑 提交于 2019-12-11 00:46:05

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/17048846/maven-build-lifecycle-for-appengineupdate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!