I\'m trying to build an implementation agnostic maven module which relies on JPA2. Unfortunately, the only Maven JPA dependency is JPA1 based, and consequently, I cannot us
I was able to solve resolve my Maven JPA2 dependency by adding a couple of dependencies to the project's pom.xml file. See below for the xml code for the dependencies.
I found the latest groupId's and artifactId's versions by drilling down the directories out on Maven Central. I just walked the directory tree until I found the metadata.xml files for the persistence.core and the persistence.jpa artifacts.
Note: The dependency on persistence.jpa is what actually brings in the javax.persistence jar.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.1.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.6.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.6.4</version>
<scope>compile</scope>
</dependency>