Eric is a DZone MVB and is not an employee of DZone and has posted 17 posts at DZone. You can read more from them at their website. View Full User Profile

Developing a Google App Engine (GAE) app using Maven

03.04.2010
| 14169 views |
  • submit to reddit
If you want to develop a Google App Engine (GAE) application using Maven, you can either use the Maven plugin maven-gae-plugin, which requires non-trivial hacking on your pom.xml, or you can keep your pom clean and create a simple Ant script.

My pom is a simple web application pom, with no specific GAE configuration.  I then created a build.xml in my project root that looks like this:
<project>
<property name="sdk.dir" location="/opt/appengine-java-sdk-1.3.1" />

<import file="${sdk.dir}/config/user/ant-macros.xml" />

<target name="runserver" depends=""
description="Starts the development server.">
<dev_appserver war="target/yourappname-1.0-SNAPSHOT" />
</target>

</project>
Using this, you can run your application in the GAE sandbox without having it take over your pom.

You can also have the ant task perform a maven package to insure everything is updated by adding an exec target to the runserver task.

You can read more about the full range of Ant tasks available for GAE, but I found this simple script helpful to get up and running quickly in the GAE sandbox without much effort.
References
Published at DZone with permission of Eric Daugherty, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Ben Tilford replied on Thu, 2010/03/04 - 8:23pm

The maven-gae-plugin is actually a lot easier to use.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.