Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which App Engine Maven Plugin to use?

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

like image 386
majinboo Avatar asked Nov 16 '16 08:11

majinboo


People also ask

How do I run the Google App Engine in eclipse?

To create a new project for the App Engine standard environment in Eclipse: Click the Google Cloud Platform toolbar button . Select Create New Project > Google App Engine Standard Java Project. Enter a Project name and (optionally) a Java package.

What is App Engine Good For?

Google App Engine is a great tool for app building that provides support for a lot of languages and scalability options when the user base increases by creating parallel instances of the app which reduces the downtime.

Can I use App Engine for free?

Apps in the standard environment have a free tier for App Engine resources. Any use of App Engine resources beyond the free tier incurs charges as described in this section. To estimate costs for App Engine resources in the standard environment, use the pricing calculator.


2 Answers

<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`

like image 162
Deviling Master Avatar answered Sep 20 '22 22:09

Deviling Master


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.

like image 38
Aram Paronikyan Avatar answered Sep 20 '22 22:09

Aram Paronikyan