升级到Play framework 2.4后的JPA依赖问题

时间:2015-05-29 05:27:34

标签: jpa playframework-2.0 playframework-2.4

Ebean ORM已从主Play核心中撤出,并已在Play 2.4中作为依赖项引入。很棒的举动。

但这打破了现有的代码。按照Ebean的Play migration说明操作后,我收到了几个JPA注释错误。经过调查,似乎ebean正在拉动JPA 1.0持久性API。

[info]   | +-org.avaje.ebeanorm:avaje-ebeanorm-agent:4.5.3
[info]   | | +-javax.persistence:persistence-api:1.0
[info]   | |
[info]   | +-org.avaje.ebeanorm:avaje-ebeanorm:4.6.2
[info]   |   +-com.fasterxml.jackson.core:jackson-core:2.4.1 (evicted by: 2.5.3)
[info]   |   +-com.fasterxml.jackson.core:jackson-core:2.4.3 (evicted by: 2.5.3)
[info]   |   +-com.fasterxml.jackson.core:jackson-core:2.5.3
[info]   |   +-javax.persistence:persistence-api:1.0
[info]   |   +-org.slf4j:slf4j-api:1.7.12
[info]   |   +-org.slf4j:slf4j-api:1.7.7 (evicted by: 1.7.12)

在Play 2.3.9中,情况并非如此,它正在拉动i jpa 2.0

[info]   | +-org.avaje.ebeanorm:avaje-ebeanorm-agent:3.2.2
[info]   | +-org.avaje.ebeanorm:avaje-ebeanorm:3.3.4
[info]   | +-org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final
[info]   |
[info]   +-com.typesafe.play:play-java-jdbc_2.11:2.3.9 [S]
[info]   | +-com.typesafe.play:play-java_2.11:2.3.9 [S]
[info]   | | +-com.google.code.findbugs:jsr305:2.0.3
[info]   | | +-com.google.guava:guava:16.0.1

关于排除JPA 1.0并依赖于hibernate-jpa-2.0-api的任何指针?

1 个答案:

答案 0 :(得分:0)

您可以从ebean依赖项中排除persistence-api。

这样的东西
("org.avaje.ebeanorm" % "avaje-ebeanorm" % "4.6.2").exclude("javax.persistence","persistence-api")