Which App Engine Maven Plugin to use?
Asked Answered
C

2

7

been working with Google App Engine lately and stumbled upon something that is a mystery to me, maybe you can clarify.

According to some of Google's own websites (https://cloud.google.com/appengine/docs/java/tools/maven) you should use

<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin.version}</version>
</plugin>

and according to some other pages (https://cloud.google.com/appengine/docs/java/tools/maven-reference) you should use

<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.1.0-beta</version>
</plugin>

Now I am really confused as to which I should use. Why are there two versions in the first place?

Problem I am facing:

The both seem to support different goals. One supports deploy etc. and the other one update and update_cron.

I need all 3 of those goals, any way I can have them with one dependecy?

Thanks in advance, hope someone can help me with this.

Sascha

Cressi answered 16/11, 2016 at 8:31 Comment(0)
C
6
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin.version}</version>
</plugin>

The first one is based on the previous (but not deprecated) appcfg (or Java SDK).

It offers a lot of Goals specific for App Engine, the basic ones with the dev-server and the deploy, but also for update queues, update cron, update indexes, vacuum indexes, ...

<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.1.0-beta</version>
</plugin>

It's the newest one, still in beta. It is based on GCloud SDK and has a limited set of goals.

Here you can see the latest version from Maven Central, the latest one is 1.0.0, I don't see the 1.1.0-beta version

How to choose the proper plugin: If you only need to use dev-server and deploy you can use the newest plugin based on GCloud SDK.

Those 2 goals are also available in the appcfg based plugin, but if you need more specific goals (like handling queue, cron, indexes, ...) are only available with this last one.

Also, the Google Cloud Endpoints goals, are only available to the appcfg one

At the end, those 2 plugin can coexists in the same project. The trick to use both of them is using the goal full path instead of the short one (source).

For example:

  • com.google.cloud.tools:appengine-maven-plugin:run
  • com.google.appengine:appengine-maven-plugin:devserver

And not

  • appengine:run
  • appengine:devserver

If you use the shorter version, Maven is unable to resolve the proper groupId (because the artifactId is the same on both plugins)

For the moment both plugins are operative and there is not trace of a deprecation about the appcfg based one.

Take me for example, I always use the deploy within the GCloud plugin (I consider it slighty better as deploy procedure compared to the appcfg one), but when I need to update cron/queues I use the goal of the previous plugin. I do not have any problem on having both on them inside my project

Remember that if you want to use the GCloud based one, you need to have GCloud installed (and configured) on your local machine.

Here is another thread which is discussing the same topic: `gcloud app deploy` vs. `appcfg.py`

Certification answered 16/11, 2016 at 18:3 Comment(3)
both of the plugins are updated continuously. old one: 1.9.60 2017 Dec, new one; 1.3.2 2017 Nov (there is a 99.99.99 version which is very strange). Meanwhile, there are two pages of Google Doc talk about them separately, the old one: cloud.google.com/appengine/docs/standard/java/tools/maven, the new one: cloud.google.com/appengine/docs/standard/java/tools/using-mavenAdept
according to this page cloud.google.com/appengine/docs/standard/java/tools/…, we can see Google provide a migrate method to migrate com.google.appengine.appengine-maven to com.google.cloud.tools.appengine-maven, so maybe the new one is a good choice if you start a new maven project.Adept
They do authenticate differently, for that reason I had to use the com.google.cloud.tools when setting up deployment from Jenkins.Mitzvah
C
2

The official documentation for both plugins is linked below:

com.google.appengine groupId

com.google.cloud.tools groupId

Both plugins are supported, they have the same artifactId (appengine-maven-plugin), but different goals and behave differently. I think this is another case of bad organization of a software evolution by Google. They could simply keep a single plugin and transparently move from one SDK to another by checking their existence in the environment, posting warnings/recommendations etc.

Congregate answered 28/6, 2017 at 16:45 Comment(1)
Yes! I personally find this to be extremely confusing! Wish they would stop having so much disambiguated features and documentation.Lustrous

© 2022 - 2024 — McMap. All rights reserved.