Greetings.
I’m just starting to explore Maven and I use m2eclipse as to use Maven in Eclipse.
I found that there is a hibernate-based archetype with
Group Id: com.rfc.maven.archetypes and
Artifact Id: jpa-maven-archetype
Does anybody knows if there are archetypes for OpenJPA-based projected with test frameworks included?
Thanks a lot.
Not to my knowledge. So my suggestion would be to use the jpa-maven-archetype and to tweak it for OpenJPA and JPA 2.0.
First, generate a project:
Then
cdinto the created directory and modify thepom.xmlto replace Hibernate by OpenJPA artifacts, add the OpenJPA plugin for enhancement (I did a few other minor tweaks):Then modify the
persistence.xmlfor JPA 2.0 and add the OpenJPA specific properties:And replace the following lines in
UserTest.java(and clean up imports):By (OpenJPA doesn’t support the
EntityManager#unwrap(Object)from JPA 2.0 yet, see OPENJPA-1803, so you have to use OpenJPA specific classes):And run the test: