Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top