Serving multiple GAE modules from one development server?

前端 未结 2 1593
猫巷女王i
猫巷女王i 2020-12-10 08:41

I\'m converting some backends to modules and am perplexed on setting up the development environment configuration. I\'m using Java in Eclipse but not Maven. The architecture

相关标签:
2条回答
  • 2020-12-10 09:35

    I'm having similar problems figuring out how to implement multiple modules in the MyEclipse plugin for Google App Engine. The best information I've found just says to use Maven.

    "Although Java EE supports WAR files, module configuration uses unpacked WAR directories only. App Engine's Java SDK includes an Apache Maven tool that can build a skeletal EAR structure for you." (source: https://developers.google.com/appengine/docs/java/modules/)

    I also found this:

    "A Maven project has a different layout than an Eclipse project. So, if you wish to use a Maven project with Eclipse, you need to do a bit more work. You have the following options:

    1] Import a Maven project for App Engine into Eclipse as a Web Tools Platform (WTP) project, as described in Importing an Existing Maven Project.

    2] Import the Maven project into Eclipse using an appropriate Maven integration plugin such as m2eclipse.

    3] Set up two debug configurations, one for the Maven project in devserver (mvn appengine:devserver), and one for a Remote Java Application that you use to connect the Eclipse debug client to the devserver jvm. For details on how to do this, see ..." (source: https://developers.google.com/appengine/docs/java/tools/maven#creating_a_new_maven_app_engine_project_using_skeleton-archetype)

    I know you said you're not using Maven, but might you consider trying it?

    0 讨论(0)
  • 2020-12-10 09:39

    If you follow the instructions here, this will create a modularized application structure in Eclipse, and not using Maven at all. You will need Eclipse WTP in order to have the required project types available (Enterprise Application Project and Dynamic Web Project).

    The Eclipse project structure should look as follows:

    <<Enterprise Application Project>> ear-app
        |
        | (refers to)
        |
    <<Dynamic Web Project>> app-module-1  "default"
    <<Dynamic Web Project>> app-module-2  "any_name_2"
    <<Dynamic Web Project>> app-module-3  "any_name_3"
    <<Dynamic Web Project>> app-module-4  "any_name_4"
    

    The value of "name" refers to the "module" element in appengine-web.xml, while the physical web project can have any name.

    Please note that you need to switch into J2EE perspective in order to have the GPE WTP menu options available, they do not show up in the standard Java perspective.

    Next, you need to link the EAR project to a new local server instance (of type "Google App Engine").

    Only one of the web modules must be flagged as "default" in appengine-web.xml.

    Upon deployment of the EAR to the local server, the datastore location is in WEB-INF/appengine-generated/local_db.bin of the default web module, and it is shared between the web modules.

    0 讨论(0)
提交回复
热议问题