8
votes

Google just came out with JDO 3.0 (which uses DataNucleus 2.0) for Google App Engine, and I want to use it, since it conveniently supports unowned relationships. I've been trying for days, but I can't figure out how to use it with the Google Eclipse plugin. I've found this web page https://developers.google.com/appengine/docs/java/datastore/jdo/overview-dn2, but my project folder doesn't have a build.xml file. I tried creating a separate project and transferring all my code, but the new project didn't have JDO 3.0, nor did it have a build.xml file.

Any help would be much appreciated.

4
If it requires a build.xml file, then it probably requires that you are using ant as your build tool. Are you?Travis Webb
Thanks for responding, Travis. It looks like you can use EITHER the Google plugin for Eclipse OR Ant to build a GAE project. The instructions on that page are, I guess, how to upgrade to JDO 3.0 when using Ant. Is there a way to upgrade to JDO 3.0 using the Google plugin?Jeremy
Or could someone tell me how to switch my project builder from google plugin to Ant?Jeremy

4 Answers

6
votes

I just installed the new Eclipse and GPE (since upgrading my eclipse completely destroyed it, I had no other option).

Did you update your version of GPE? Mine is:

Google Plugin for Eclipse 4.2 3.1.0.v201208080121-rel-r42

After that, you should be able to switch to JDO 3.0 by selecting Datanucleus JDO/JPA v2 in the project properties under Google / App Engine. As far as I understand, the GPE v2 is actually JDO v3.0 by looking at the jars that are copied to the output directory. Mine is /war/WEB-INF/lib/datanucleus-api-jdo-3.0.7.jar

2
votes

You could switch the project building to ant by following the guide here: https://developers.google.com/appengine/docs/java/tools/ant#Creating_the_Build_File

To actually run it in eclipse, 1. Right click at the build.xml 2. Run As -> Ant Build ... 3. Select target "runserver"

0
votes

Currently, you must use Apache Ant in order to use JDO 3 or JPA 2. That document is not very well written, but it states after the Migration part:

"Currently, you must use Apache Ant to use version 2.x of the DataNucleus plugin for App Engine."

Also, "The App Engine Java SDK includes version 2.x of the DataNucleus plugin for App Engine. This plugin corresponds to version 3.0 of the DataNucleus Access Platform, which enables you to use the App Engine Datastore via JDO 3.0."

Too bad, my friend :(

0
votes

Currently you no longer need to use Apache Ant. Wit the latest GPE 1.7.3 you can select data nucleus v2 in Google App Engine project properties