Monday, July 23, 2012

Google DataStore with JPA and Spring

I like Google App Engine. It's fast, reliable and free. It also comes with Google DataStore, a NoSQL solution to store data. The only problem is that it isn't that easy to use with the technology you want. We, for instance, wanted to use JPA and Spring. We've been struggling for a little while, but in the end, we managed to get all the right libraries. To make our life easier, we poured all those libraries in a Maven POM file, and made an archetype out of it. That way, we can just generate a new project from that archetype, and we're good to go!

Follow these steps to get started (You need Maven 3 to sucessfully run the app!)
mvn archetype:generate -DarchetypeGroupId=be.c4j -DarchetypeArtifactId=gae-wicket-archetype -DarchetypeVersion=1.0 -DgroupId=be.c4j -DartifactId=gaeproject -DinteractiveMode=false
  • The parts in bold are what defines your projectname and default package
  • On the newly created project, do a mvn gae:unpack 
  • Now you can mvn gae:run your application
  • It's just a simple Wicket Hello World app, but it's a base to start from
This setup was made to prepare our Summer of Technology session. A lot of thanks go to Sebastian Van Sande for sorting out dependency issues and creating the archetype.






1 comment:

  1. This post answers exactly what I was looking for: how to generate GAE project with JPA 2 and spring. It is clear, concise, very up-to-date and works as described. Many thanks for that.

    ReplyDelete