Where can I find a JPA2 Maven dependency?

后端 未结 7 1779
情话喂你
情话喂你 2020-12-09 01:50

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

相关标签:
7条回答
  • 2020-12-09 02:33

    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>
    
    0 讨论(0)
提交回复
热议问题