TurboManage

David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler


    Web app developer since 1994 and Google Cloud Platform Instructor now residing in Colorado. Besides tech, I enjoy landscape photography and share my work at ColoradoPhoto.gallery.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 223 other followers

  • Sleepless Nights…

    June 2011
    S M T W T F S
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
  • Blog Stats

    • 1,029,169 hits

Archive for June 25th, 2011

Preserving the Datastore when using App Engine dev server with Maven

Posted by David Chandler on June 25, 2011

Problem

I’m currently working on a GWT+GAE Maven project and the local datastore gets wiped every time I start the dev server, whether using mvn clean gae:run or Google Plugin for Eclipse.

Cause

Per the official dev server doc, the local datastore is stored in WEB-INF/appengine-generated/local_db.bin. For most Maven projects, the WEB-INF directory is located under target/${project.build.finalName}, so local_db.bin is under the target directory, which gets wiped every time you mvn clean. It also gets wiped when launching dev mode with Google Plugin for Eclipse.

Solution

Specify an alternate path to the dev server datastore.

In Eclipse, edit the project’s Run Configuration and add this to the VM args:

-Ddatastore.backing_store=${project_loc}/local_db.bin

This will put the local datastore in the project root directory, where it won’t get wiped every time you launch the dev server.

In the project’s POM, add this to the configuration section for maven-gae-plugin:

<jvmFlags>
	<jvmFlag>-Ddatastore.backing_store=${project.basedir}\local_db.bin</jvmFlag>
</jvmFlags>

Many thanks to Marcel Overdijk for pointing the way on the maven-gae-plugin group.

Posted in AppEngine | 4 Comments »

 
%d bloggers like this: