Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup IntelliJ Java App Engine project to use Services (Modules)

I've been using IntelliJ successfully for quite a while to develop App Engine projects that contain a single service (formerly 'module'), but am having difficulty setting up a project up that contains more than one service (a default front-end service plus one or more backend services).

I understand the multi-module EAR deployment folder structure, which is different from the single WAR structure, but I have not been able to figure out how to successfully launch the development server with this configuration to debug before I deploy.

Any help would be greatly appreciated.

like image 922
Brian McGann Avatar asked Jun 30 '16 01:06

Brian McGann


People also ask

How do I run a module in IntelliJ?

From the main menu, select Run | Show Running List. In the top-right corner of the editor, IntelliJ IDEA shows a list with all active applications.

What is the difference between Project and module in IntelliJ?

A project can contain one or more related modules. Each module is a separate library, application and can be a jar, ear or war. Also modules aren't just Java either.

How do I add an existing module to IntelliJ?

Import an existing module From the main menu, select File | New | Module from Existing Sources. In the dialog that opens, specify the path the . iml file of the module that you want to import, and click Open. By doing so, you are attaching another module to the project without physically moving any files.

How do I create a Web service client in IntelliJ?

Develop Web services client applicationsCreate a Java module and enable support of the desired Web services client in it. Generate the client-side XML-Java binding. Modify the generated code to have the client properly initialized.


1 Answers

My application is structured as a multi module Gradle project. I have a top level Gradle Build file and three subprojects. One project contains the EAR project, and two projects are Goolge App Engine War projects.

I would propose that you start with trying to setup such a project. You will find a good example with a corresponding project structure at Googles Github

https://github.com/GoogleCloudPlatform/appengine-modules-sample-java

You will deploy the ear to your locale dev server by running the ear gradle task appengineRun

You need to add the following entry to your ear gradle build file (keep the other entries)

appengine {

    jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000']

}

Next step is to configure a Remote Debug configuration similar to this

https://stackoverflow.com/a/18692212/2062634

After you started your application you have to start your remote debug configuration which will attach the debugger.

like image 77
Michael Meyer Avatar answered Oct 11 '22 10:10

Michael Meyer