Can Google App Engine / GWT plugin work with multi-module projects? - google-app-engine

The getting started tutorial for Google App Engine / GWT describes a very simple application using a single eclipse project (module). I'm porting a JPA / Hibernate based project to GAE and have a service layer module. It all compiles but when I attempt to run as a web-app from eclipse, obviously it doesn't have access to the service layer.
How do I get Eclipse to build a Jar, and include it (with the src) in the GWT project module - i.e. deployed to the WEB-INF/lib directory?
I can't believe that Google are not addressing this and seem to have just skimmed over this gaping hole.

You should use Ant and setup an Ant Builder that executes when you save your java classes to create the Jar
This should accomplish what you are looking for.

Related

Migrate from Google Plugin for Eclipse to Cloud Tools for Eclipse

I have an application in App Engine + Java GWT with MVC architecture (Google Web Application Project). I have three sections of code - Server, Client and Shared all under one GWT project.
This was initially built using the Google Plugin for Eclipse. I now want to migrate to the new 'Cloud Tools for Eclipse'
I have already tried following the steps here :
https://cloud.google.com/eclipse/docs/migrating-gpe
The above was unsuccessful.

Best way to create Cloud Endpoints 2.0 app with Objectify now that Android Studio 3 doesn't have endpoints modules

Back in Android Studio 2.0 you could just add a Cloud Endpoints 1.0 backend module and it would generate for you a sample project that used Objectify. It was very convenient.
However, Android Studio 3.0 no longer has this feature and Cloud Endpoints 2.0 requires you use IntelliJ Ultimate edition to generate a App Engine Standard Environment project. However... IntelliJ Ultimate edition costs $500 and it doesn't appear a sample project with Objectify is created... Sigh...
So my question is, what is the best way to create a sample Cloud Endpoints project that uses Objectify? Because as of right now there appears to be no clear way from reading the documentation unless you want to shell out $500 for IntelliJ Ultimate edition.
Am I missing something??
I would suggest using the sample app as a start. You can import it as a Gradle project to Android Studio. Adding Objectify manually shouldn't be too difficult from there.
In addition to what is commented in the previous answer, if there are any doubts regarding how to use Objectify with App Engine, you can check out this code for integrating Objectify on a Java application.
You can run it using Maven as this:
mvn clean package
mvn appengine:run
After running it locally, you can deploy the app and check it works correctly:
mvn appengine:deploy
Once you check it works and understand the code, you can integrate it with the sample app indicated in the previous answer and combine them to create your Endpoints project with Objectify.

How to deploy a SpringBoot REST Application to Google App Engine?

Tried
Subscribed trial for GoogleAppEngine.
1. INSTALLED GOOGLE APP ENGINE SDK
2. Downloaded the sample Java started code and deployed it. Working fine.
3. Used $appcfg.sh -A <appname> update target/appengine-try-java-1.0 to deploy
4. In this case, its a folder with all the webapp related stuffs
Question
In my case, I have a spring boot application which generates a jar file. It runs with a embedded container and I believe Google may have an alternate to deploy using Docker or some other way. But how?
There is no pointer or any details on how to run this in Google managed platform as far as I searched.
Any help or reference to documentation!! Alternates??
You can now use Google App Engine Java Flexible Environment - Java 8 Runtime:
https://cloud.google.com/appengine/docs/flexible/java/dev-java-only
It is Docker based
UPDATE:
You can now use Java 8 in App Engine Standard Environment:
Tutorial:
https://codelabs.developers.google.com/codelabs/cloud-app-engine-springboot/index.html
Example:
https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/springboot-appengine-standard
Blog post:
https://cloudplatform.googleblog.com/2017/09/Java-8-on-App-Engine-Standard-environment-is-now-generally-available.html
Google App Engine still uses Servlet 2.5 that is below the requirements of Spring Boot (i.e. Servlet 3.0).
There is a way to workaround that, check the documentation for more details
Spring Boot requires Servlet 3.0 which GAE does not have. WorkAround is to have a "spring-boot-legacy" dependency. You can check further how to implement: https://github.com/scratches/spring-boot-sample-gae

Uploading mirror Java Quickstart to App Engine

Question about getting the Java starter project booted up on Google App Engine
https://developers.google.com/glass/quickstart/java
In that quickstart when configuring Eclipse it says
Uncheck the Use Google App Engine checkbox and save.
However if I follow the instructions on the above page - including Eclipse with the Google plugin - I get a project which can be run on localhost. If I try to upload the App Engine it says this is not a App Engine project and won't upload.
So then if I make it one (go under the Google->App Engine settings) the Eclipse project complains about the jars under
web/WEB-INF/lib
and still won't upload. If I delete them then I get a project that doesn't compile either. So what do I need to do specifically to get this to load to the cloud?
Related to this is that I'm confused about the relationship between Maven and Eclipse - the two seem to be a cross purposes as Maven populates the lib directory but I keep wrangling with Eclipse over it too. The App Engine plugin seems to want to use it's jars, while the app-engine code I downloaded per the instructions (to get the bin utils app-cfg) want to be used too by Maven AFAIK.
Deploy to App Engine from the command line using appcfg.sh.
Getting many IDEs and App Engine to all work in the same project has led to some compromises due to differing assumptions made by each of the tools involved. For example, the Eclipse App Engine plugin makes different assumptions about the structure of projects than other IDEs. The compromise was to fall back to the official command line tools since they seem the most tolerant of variation and are always available.
Maven is part of the project to handle dependency management.
If you'd like to use Eclipse for your deployment too, you'll probably want to create a new Eclipse App Engine project and copy the libraries and code into that project.

package of google app engine project

HI I m new to google app engine,and I want to know is there an option in app engine to create a installer package of a project which can be deployed in other google app domains.So basically project will not be hosted publically but only for particular google app domains
An analogy I m looking here is salesforce package,where a developer can create a package url,through which package can be installed in other orgs. The project is not hosted publically. http://appexchange.salesforce.com/
You can package your source easily. The only variable that needs to change is in app.yaml application: field in python and appengine-web.xml in java. This will allow you to deploy the app in other domains.
As far as the package url that isn't how App Engine works. You can set your application to allow only certain domains to access it and provide an API for integrating it into another application, but that is different than Sales Force package url.
When developing a Google App Engine application you don't have to specify the url of the project. So you can install and deploy your application to several organizations or even subprojects.
The only thing you need to set is the application name in the app.yaml (in case you are using python) or appengine-web.xml (for java)
So for developing an installer I would create a script that first asks the user for the name of the application they want to deploy to, modifying the configuration files accordingly, and then calls the normal appcfg.py installer.

Resources