Embrace Google App Engine development with IntelliJ IDEA

DZone 's Guide to

Embrace Google App Engine development with IntelliJ IDEA

· Cloud Zone ·
Free Resource

If you're attracted by the idea to have your Java-based web applications run on the Google App Engine, look at how easy it actually is to develop and deploy on the cloud with IntelliJ IDEA. The coming major update of IntelliJ IDEA, version 9 with code name Maia, currently available under EAP, contains built-in support for the Google App Engine. In the article I'd like to give you a quick tour through all the options you get.

Setting it all up

When starting a new web project in IDEA, make sure you select the Google App Engine checkbox and set properly the location of you App Engine SDK once you reach the last step in the project creation wizzard.

Once you do it, IDEA will add all required descriptors and libraries to you project and configure dependencies accordingly.

If you're instead willing to "cloud-enable" an existing web project, all you need to do is to set the Google App Engine facet on your web module. Open the Settings dialog with Control + Shift + Alt + S, add the facet and specify the location of you App Engine SDK.

Code for the cloud

From now on your application is considered to be deployable on GAE and any violations to the rules imposed by GAE on your code, like e.g. creation of a new thread, are marked by IDEA's code analysis engine as errors. Right there, directly in your code.

Alternatively you can review all such violations by running the code inspections on-demand and get a consolidated report.

A dedicated Run Configuration is also available to enable running or debugging your GAE application on the AppEngine SDK inside IntelliJ IDEA.

Now you can run your app with the Control + F10 keyboard shortcut any time. The local GAE SDK server will start and send its output into the IDEA's output window. Hit Control + F2 to terminate the server.

Fix the bugs

I don't know about you, but I usualy make quite a few mistakes in my code and frequently need a help from the debugger to find out what I did wrong. IDEA allows you to debug applications run on the local GAE SDK server, view stacktrace, variables, watches, evaluate expressions, label elements, set their values or perform a lot of other useful activities, just like in plain (non-cloud?) Java projects.

And for the polyglot enthusiasts among us, these all debugging options are obviously available in Groovy code as well.

Time to deploy

Once you're ready to deploy, feel free to use the Upload App Engine Application command from the tools menu.

Your application will be uploaded to Google App Engine and will become available to the outside world.

Now you the application is public. Have fun deploying on the cloud!



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}