Datanucleus 2 / JPA2 setup

142 views
Skip to first unread message

Marcel Overdijk

unread,
May 29, 2012, 9:18:57 AM5/29/12
to maven-ga...@googlegroups.com
Has somebody already setup the GAE Maven Plugin with Datanucleus 2 / JPA2?

Marcel Overdijk

unread,
Oct 15, 2012, 4:27:22 PM10/15/12
to maven-ga...@googlegroups.com
bump, anyone?

tuc...@yasenevo.ru

unread,
Nov 21, 2012, 9:58:35 AM11/21/12
to maven-ga...@googlegroups.com
I tried, but i got OMFException during EMF initialization. No idea what should I make


On Tuesday, May 29, 2012 3:18:57 PM UTC+2, Marcel Overdijk wrote:

babajide...@gmail.com

unread,
Mar 20, 2013, 10:51:52 AM3/20/13
to maven-ga...@googlegroups.com
Yes I managed to get JPA 2 wroking with Maven,

Here is my pom:

<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.0</gwtVersion>
<gxtVersion>2.2.0</gxtVersion>
<gae.version>1.7.5</gae.version>
<datanucleus.version>3.1.3</datanucleus.version>
<!-- GWT needs at least java 1.5 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<!-- DN -->
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>${datanucleus.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>${datanucleus.version}</version>
</dependency>

<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>${datanucleus.version}</version>
</dependency>
<dependency>
<groupId>javax.jdo</groupId>
<artifactId>jdo-api</artifactId>
<version>3.0.1 </version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.0</version>

</dependency>
<dependency>
 <groupId>com.google.appengine</groupId>
 <artifactId>appengine-jsr107cache</artifactId>
 <version>1.7.5</version>
</dependency>

<dependency>
 <groupId>com.google.appengine</groupId>
 <artifactId>appengine-endpoints</artifactId>
 <version>1.7.5</version>
</dependency>
<dependency>
 <groupId>net.sf.jsr107cache</groupId>
 <artifactId>jsr107cache</artifactId>
 <version>1.1</version>
</dependency>


<!--For the Enhancer Include under plugins-->

<plugin>
<groupId>org.datanucleus</groupId>
<artifactId>maven-datanucleus-plugin</artifactId>
<version>${datanucleus.version}</version>
<configuration>
<api>JPA</api>
<verbose>true</verbose>
<mappingIncludes>**/entity/*.class</mappingIncludes>
<fork>false</fork>
<log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>

Good luck and remember to read  here https://developers.google.com/appengine/docs/java/datastore/jpa/overview-dn2 on what JPA2 features is supported 

Remember to include persistence.xml in root of application, in this case src/main/resources

Cheers
Babajide Agbebiyi
Reply all
Reply to author
Forward
0 new messages