Selecting GWT module to compile for deployment to App Engine - google-app-engine

I introduced additional GWT modules where previously there's only been one in my GWT/GAE project. When deploying to App Engine via Google Plugin for Eclipse I noticed that the plugin compiles all the GWT modules in the project, which is not what I want. I wasn't able to find a way to tell GPE which GWT modules to compile for deployment. Is this at all possible?

Apparently GPE compiles GWT modules in the module list found in Project Properties --> Google --> Web Toolkit so removing modules from there did the trick. I was expecting to find either a way to select GWT modules from the GAE Deployment Dialog or to edit some configuration file.
It has to be admitted that relying on such GPE settings is not a great way to make consistent deployments. Maven-based builds and deployments made outside of Eclipse are likely a better way to go.

Related

Google Endpoints V2 and Maven plugin version?

We have a multi-module (war-packaged) project that uses com.google.appengine - appengine-maven-plugin target being ear file.
We have migrated succesfully to Java8 and EndpointsV2. It builds and runs fine in Cloud. However the following requirement is still a bit questionmark in the migration instructions. What is the reason behind this incompatibility and requirement? Or is it just related to for example "discovery docs" that we are not using anyway?
The old App Engine Maven plugin, with group com.google.appengine, is incompatible with the Endpoints Framework plugin. You must use the new version shown above
https://cloud.google.com/endpoints/docs/frameworks/java/migrating
If you aren't using discovery docs or generated client libraries and are only using Endpoints as a library dependency, you can remove the Endpoints plugin and the error should go away.

Can't deploy EAR to Google App Engine 1.9.4

I'm having troubles deploying a Google App Engine EAR application from Cloudbees. The application is built using 1.9.4. The application structure is similar to this project: https://github.com/deege/gae-rest-skeleton The main difference is I have more than just one module.
The problem I'm running into is how to configure the deployment. I have the "Post steps | Deploy Applications | Google App Engine (Java)" set up as the video from their site, but the configuration is expecting a WAR directory structure in the Fixed Directory section.
It's looking for a directory where a WEB-INF/appengine-web.xml file exists. I can point the configuration to the front end's directory where this does exist (and was doing that until I added more modules), but then it only deploys the front end. None of the other WARs are deployed.
I think it should be looking for the META-INF/appengine-application.xml file in the ear directory, since this describes the whole application (front ends and supporting modules).
Is there something I'm missing with the configuration? Do I need to deploy each module (WAR) separately?
Our deployer plugin was written before GAE added support for EARs. If ignoring the form validation and just entering the configuration that you know should work doesn't work then open a ticket.
I will be investigating and adding the extra form validation to the plugin at my next review window for the plugin, but an interim workaround of just ignoring any displayed errors should work
update
I have updated the app engine deployer plugin. Upgrading to version 3.0 or newer will allow you to deploy EAR exploded archives

Can't import library into Google App Engine project

I use the Google App Engine SDK 1.8.5 with Eclipse 3.8 on Ubuntu.
I want to add the Cloud Storage service to my app, so I downloaded guava-gwt-15.0.jar and appengine-gcs-client-0.3.jar, and put them in my apps /war/WEB-INF/lib/ folder. I also added these jars to the build path in Eclipse.
When I fire up my app in dev mode, it runs fine, at least until I try to access a page relevant to the GCS library. When I do that, I get the following error:
java.lang.NoClassDefFoundError: com/google/common/base/Preconditions
at com.google.appengine.tools.cloudstorage.GcsServiceImpl.<init>(GcsServiceImpl.java:35)
at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createGcsService(GcsServiceFactory.java:32)
... etc
I cleaned my project and restarted Eclipse multiple times, and still the problem persists. What to do?
In addition to Guava for GWT, you also need the core Guava library (guava-15.0.jar). Download the .jar to war/WEB-INF/lib and add it to you build path as well.

Google App Engine Eclipse plugin without using GWT

I want to host a Java/AngularJS app on Google App Engine, and leverage the Eclipse plugin. I figure the most straightforward way to do this is:
From within Eclipse, start a new Google Web Project.
Go to project properties and uncheck GWT and DataNucleus.
Delete the generated java classes and GWT related stuff so you have an appengine.web.xml, web.xml, WEB-INF/lib, log4j properties, and a few other files left.
Put index.html under the war folder, sister to favicon.ico.
Change web.xml welcome file to index.html
Deploy and test that index.html is visible.
Deployment via Eclipse works fine, but myapp.appspot.com/ and myapp.appspot.com/index.html both return 404.
Simply put my use case is "how do I deploy an index.html to GAE (using Eclipse plugin) without the 800 pound guerilla that is GWT?"
I was unable to find good documentation on this.
Unchecking 'Use Google Web Toolkit' should be all you need to do to create a basic App Engine application without GWT, however, it will not create a sample index.html file. For that, you need to keep 'Generate project sample code' checked. This will create some extra Java files for you that you'll need to delete, but it's the closest you can get to what you described in your question.

Importing google app engine project from eclipse into intellij

I'm trying out intellij to see what it is like to develop/maintain google app engine projects. I've used the GAE plugin for eclipse for a couple of years and it usually worked flawlessly for me but I've heard a lot about intellij recently so I wanted to see what I was missing.
I've read many sites that describe step-by-step how to create new GAE projects in intellij but none that describe how to do so for existing projects. I'm struggling with I imagine is some intellij 101 topics. I have a few questions that I'm bundling together here:
I added the Web/GAE facet to the project and specified the appropriate GAE SDK directory and appengine account info. What's the right way to associate the right SDK jars with my project?
IntelliJ recognized my maven imports and added them to my External Libraries, things like apache commons, slf4j, etc. How do these jars make their way into the (exploded war) artifact I created for the project? Are they automatically copied there after a successful compile?
I'm using JDO so I downloaded the DataNucleus plugin. How do I wire it up so it enhances my classes?
Thanks in advance.
File - Project Structure - Modules - AppEngine: at the right side is "Path to AppEngine SDK install directory". Click button right to it to select dir via file selector. This is the right way - here Intellij will use all the needed jars in your project, no need to add GAE jars by hand .
File - Project Structure - Artifacts: you should have a war artifact here. Create one if it's not there (+). Jars used in the project should be in "Available Elements" pane. You can add jars (if not added automatically) by drag-n-dropping them between panes. Yes, jars will be copied into war if they are in the left pane showing the contents of the package.
File - Project Structure - Modules - AppEngine: check the "Run enhancer for the following classes.." and select your classes/packages.

Resources