Search code examples
eclipsegoogle-app-enginegoogle-cloud-platformgoogle-cloud-endpoints

Cloud Endpoints in Eclipse using Maven


How to build and deploy a Java app with its Maven dependencies on Google Endpoints using Eclipse. This guide Getting Started with Endpoints Frameworks on App Engine provides an introduction, but it doesn't mention how to build the project in Eclipse and deploy to the cloud using a Google SDK plugin for Eclipse (I need similar instruction as in this tutorial here, but for Cloud Endpoints).



Edit:
Let me put it another way:
I am in Eclipse and I click on "Google App Engine Flexible Java Project", then a default project is generated along with its configuration files (pom.xml, etc). The problem is that this project is not an "Endpoints" project, because it doesn't have files like "openapi-appengine.yaml" or "openapi.yaml". There must be a standard way that generates an Endpoints project just like we do for a web app. I couldn't find a document/page in Google Cloud documentation that describes how to use the Cloud Tools plugin in Eclipse to generate an Endpoints project.

NOTE:
This question has a chosen answer, but it is still not the optimal way to go. If you can improve it please do.
If anyone from Google is monitoring this question's tags and reads this please advise.


Solution

  • After spending a few days trying to get it to work in Eclipse, I came to a conviction that an Endpoints project can't be built entirely and tested in Eclipse and then uploaded to App Engine.

    Here is what I did instead. If anyone has a better answer, please post it.

    Solution:

    1. Use this guide to create a dummy 'Hello, World' project.
    2. Modify its EchoServlet.java class to include your application code.
    3. Modify the pom.xml file to include all the dependencies that you use in your application.
    4. Deploy the API to App Engine and test it.



    Drawback:

    There is a problem with this that you can't test any new functionality without impacting the live app since you would have to redeploy and test it directly on App Engine. I wanted to do this on a local machine using Eclipse (build and test) before deploying to App Engine.