2

My goal is to develop Java applications that use the new Google Modules. I’d like to use the Google Plugin for Eclipse because it’s simple to debug and upload to Google.

The problem is I can’t tell if it’s possible to use the Google Plugin for Eclipse for Java applications that use Google Modules.

According to this comment it’s possible to use Google Modules with the Eclipse Web Tools Platform with Google App Engine. And according to this documentation, Eclipse Web Tools Platform with Google App Engine is a component included in Google Plugin for Eclipse. But does that mean it’s possible to use the Google Plugin for Eclipse for Java applications that use Google Modules?

Community
  • 1
  • 1
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113

1 Answers1

3

Yeah, it's exactly what that comment says.

When you create a new Dynamic Web Project, make sure you select "Add project to an EAR" and select an existing EAR project or create a new one:

Dynamic Web Project dialog

Essentially, you'll have a separate Dynamic Web Project for each module and EAR project is the container for all those modules.

Now, when you want to run your whole "modularized" app, right click on the EAR project and select Run As => Run on Server.

alex
  • 2,450
  • 16
  • 22
  • Thanks Alex but I can't get to that screen because there is no "New Dynamic Web Project" when I click File=>New as instructed in https://developers.google.com/appengine/docs/java/webtoolsplatform#dynamic_web_project. I've freshly installed the Eclipse (Kepler Service Release 2) for Windows 64 bit and the Google Plugin for Eclipse. I can create an app by clicking the Google button and selecting "New Web Application Project" but that screen doesn't have an EAR membership section. I can also create the EAR by selecting File=>New=>Enterprise Application project. – Michael Osofsky Apr 18 '14 at 02:05
  • Are you sure you have the latest version of the plugin *and* Eclipse Web Tools Platform plugin installed? – alex Apr 18 '14 at 09:02
  • Thanks Alex, I installed the latest Google Plugin for Eclipse so wouldn't that include the latest Eclipse Web Tools Platform plugin? https://developers.google.com/eclipse/ says the Google Plugin for Eclipse provides "WTP-based App Engine Projects" (i.e. https://developers.google.com/eclipse/docs/appengine_wtp). – Michael Osofsky Apr 18 '14 at 21:54
  • Nope, WTP is an Eclipse project, Google Plugin simply integrates with existing WTP. To install WTP go to the usual place Help => Install New Software and choose Kepler site (or your version name of Eclipse). You'll see web tools somewhere in the list. – alex Apr 18 '14 at 22:00
  • 1
    Thank you Alex, this FAQ (http://wiki.eclipse.org/WTP_FAQ#How_do_I_install_WTP.3F) gave instructions on how to install WTP and that solved the problem. – Michael Osofsky Apr 19 '14 at 00:50
  • Out of the box with adding a second module to the EAR I get the error "Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: default=WebModule" – Dominic Tracey Apr 20 '14 at 16:31
  • 1
    @Aquilon that's because you didn't give the second module a different name. By default it's "default". When you create the second Dynamic Project, click on "next" a couple times - you'll see a "Module" input where you can set the module name during creation. – alex Apr 20 '14 at 16:41
  • 1
    @alex Perfect, thanks. Fixed by adding backend to the second modules appengine-web.xml. The documentation is a little confusing because they use "default" for the name of the default module. – Dominic Tracey Apr 20 '14 at 17:00
  • 1
    @alex You also answered my question http://stackoverflow.com/questions/22941772/serving-multiple-gae-modules-from-one-development-server/23024113 with this so thank you! – Dominic Tracey Apr 20 '14 at 17:14