appengine-modules-sample-java icon indicating copy to clipboard operation
appengine-modules-sample-java copied to clipboard

How to create this project in Eclipse

Open clocksmith opened this issue 10 years ago • 7 comments

This looks like an ear maven project. According to this documentation: https://cloud.google.com/appengine/docs/java/webtoolsplatform#enterprise_application_ear this is not supported. "Note: Currently, only Maven WAR projects are supported, not Maven EAR projects"

Also, the directory structure differs from the module overview documentation. https://cloud.google.com/appengine/docs/java/modules/

Is this the suggested way to set up an app engine project using modules, or should we use the way in the documentation? How do we convert an old project in Eclipse?

clocksmith avatar Nov 30 '14 22:11 clocksmith

Eclipse m2 WTP supports Maven project, including Maven EAR project I think. Import it in Eclipse via the import maven project. Old eclipse projects do not support EAR project.

On Sun, Nov 30, 2014 at 2:02 PM, clocksmith [email protected] wrote:

This looks like an ear maven project. According to this documentation: https://cloud.google.com/appengine/docs/java/webtoolsplatform#enterprise_application_ear this is not supported. "Note: Currently, only Maven WAR projects are supported, not Maven EAR projects"

Also, the directory structure differs from the module overview documentation. https://cloud.google.com/appengine/docs/java/modules/

Is this the suggested way to set up an app engine project using modules, or should we use the way in the documentation? How do we convert an old project in Eclipse?

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/appengine-modules-sample-java/issues/12 .

ludoch avatar Dec 01 '14 01:12 ludoch

Sorry for not being more clear. I already have an eclipse GAE using Maven WAR. I am wondering how to get it to a be a Maven EAR project so that I can use modules.

clocksmith avatar Dec 01 '14 02:12 clocksmith

yes, by creating a Maven project (EAR) like https://github.com/GoogleCloudPlatform/appengine-modules-sample-java/blob/master/appengine-modules-ear/pom.xml and replace the 2 modules there with your module.

On Sun, Nov 30, 2014 at 6:09 PM, clocksmith [email protected] wrote:

Sorry for not being more clear. I already have an eclipse GAE using Maven WAR. I am wondering how to get it to a be a Maven EAR project so that I can use modules.

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/appengine-modules-sample-java/issues/12#issuecomment-65012709 .

ludoch avatar Dec 01 '14 02:12 ludoch

I have the project able to deploy, but am still having trouble.

Let me take a step back. I originally had a war project with multiple cloud endpoints running on an app engine frontend that I configured in the admin console. I needed to make another endpoint method, but I wanted it to use a different set of instances than my regular frontend, so I found app engine backends. I read that they were deprecated in favor in "modules" so I turned to the app engine modules.

All I want is for different URLs to dispatch to different sets of instances (with different configurations) controlled with a dispatch.xml. I am finding it impossible to get the information I need out of the documentation to set this up. I found this sample project and made a new Enterprise Application Project based off of this sample, because the sparse documentation says that app engine modules need to be set up as an ear project.

  1. Where do I put my source code that is shared among modules? (I currently have it in ear/src/main/java/ but I cannot get Eclipse to recognize it as source. I also read that ear projects don't have source code so this is probably wrong)
  2. Where is the documentation for setting up cloud endpoints with modules?

Thanks

clocksmith avatar Dec 02 '14 21:12 clocksmith

Please send me the link for " sparse documentation says that app engine modules need to be set up as an ear project"...We need to address this.

Regarding shared lib across web apps, you can create yet another jar type Maven project that contains the lib content, and create a maven dependency with the n war modules that rely on this shared lib.

On Tue, Dec 2, 2014 at 1:50 PM, clocksmith [email protected] wrote:

I have the project able to deploy, but am still having trouble.

Let me take a step back. I originally had a war project with multiple cloud endpoints running on an app engine frontend that I configured in the admin console. I needed to make another endpoint method, but I wanted it to use a different set of instances than my regular frontend, so I found app engine backends. I read that they were deprecated in favor in "modules" so I turned to the app engine modules.

All I want is for different URLs to dispatch to different sets of instances (with different configurations) controlled with a dispatch.xml. I am finding it impossible to get the information I need out of the documentation to set this up. I found this sample project and made a new Enterprise Application Project based off of this sample, because the sparse documentation says that app engine modules need to be set up as an ear project.

  1. Where do I put my source code that is shared among modules? (I currently have it in ear/src/main/java/ but I cannot get Eclipse to recognize it as source. I also read that ear projects don't have source code so this is probably wrong)
  2. Where is the documentation for setting up cloud endpoints with modules?

Thanks

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/appengine-modules-sample-java/issues/12#issuecomment-65311564 .

ludoch avatar Dec 02 '14 23:12 ludoch

Here is where I got the idea: (I could have misinterpreted it but this part of the documentation is very confusing to me)

https://cloud.google.com/appengine/docs/java/modules/

"An App Engine application that uses modules is organized as an unpacked Java Enterprise Archive (EAR) directory structure. The top-level EAR directory contains a single META-INF subdirectory, and a separate directory for each module in the app. These module directories are organized as unpacked Java Web Application Archives (WAR). Each WAR directory usually has the same name as the module it defines, but this is not required. 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."

The very first sentence is confusing. It uses ear structure but is not an Enterprise Application Project? Or is it? The directory structure described here is not the same as the sample. Here is says the modules are in the top level ear directory, but in the sample they are separate top level directories. It also talks about how the "Apache Maven tool can build a skeletal EAR structure". I do not find this to be the case-- it builds regular single war projects. I have tried both the skeletal and sample versions.

clocksmith avatar Dec 02 '14 23:12 clocksmith

I happened to the same problem as clocksmith did.

MobWiMetro avatar May 26 '15 23:05 MobWiMetro