Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Google App Engine Project in Eclipse with Modules

I have been writing a GAE app with Eclipse with Maven as suggested on cloud.google.com. Recently, I needed to use "backends" or a different set of instances to handle a certain task. I found out that "backends" have been deprecated in favor of "modules". I have spent the last couple of days trying to set up the project to use modules and have made very little progress.

All I want to do is have different URLs dispatch to different sets of instances (using modules and dispatch.xml). Does anybody know how I convert my existing Eclipse project to do this? I am even willing to make a new project.

I need my modules to: 1) Use shared source code / classes from my original application 2) Have different numbers of resident instances 3) Honor the rules in dispatch.xml

I would like my project to run within eclipse and use either gradle or maven.

like image 276
clocksmith Avatar asked Nov 30 '14 22:11

clocksmith


Video Answer


2 Answers

I have same issue, i solved using this way.

Appstart (https://github.com/omerio/appstart) a boilerplate maven based multi-module App Engine application that demonstrates the use of technologies like Guice, Jersey, Objectify, Cloud EndPoints and has 3 modules a fronend module, backend module and common module which includes all the common classes including the model, which should show you an example of how to manage common code. The folder contains the following modules/maven projects

  • appstart-backend
  • appstart-common
  • appstart-ear
  • appstart-frontend

The backend module only contains code required for the backend, the frontend contains the frontend code and the common module contains common code. The projects are setup inside a parent folder 'appstart' with a parent maven POM. The common module is included in both the frontend and backend using a maven dependency:

<!-- Common module dependency -->
    <dependency>
        <groupId>uk.co.inetria.appstart</groupId>
        <artifactId>appstart-common</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

When you change the common code you can run mvn clean then install from the appstart-ear directory and it should update all dependent projects. I hope this helps

like image 192
yogesh Avatar answered Sep 23 '22 00:09

yogesh


What I ended up doing was creating a new Enterprise Application Project in eclipse, copying my code and config into the new file structure, and then reimported the project as a maven project. Things seem ok for now.

like image 45
clocksmith Avatar answered Sep 23 '22 00:09

clocksmith