如何使用Play提供的Hibernate更新?

时间:2011-11-30 08:03:57

标签: java hibernate playframework ivy

Play框架附带一个旧的Hibernate版本(3.6.1)。如何在Play应用程序中更新Hibernate?通过常春藤?

按照Pere的建议,我试过了:

require:
    - play
    - org.hibernate -> hibernate-core 3.6.8 force: true

repositories:
    - jboss:
        type: http
        root: "http://repository.jboss.org/nexus/content/groups/public/"
        contains:
            - org.jboss -> *
            - org.jboss.javaee -> *
            - org.hibernate -> *

但没有任何反应。当我在查看常春藤缓存目录时,Hibernate 3.6.8不在那里,似乎没有任何事情发生。

3 个答案:

答案 0 :(得分:3)

您应该能够按照规定in here强制推出新版本(注意:我没有对此进行过测试,现在我无法对其进行测试)。

你应该添加你的dependencies.yml

 - org.hibernate -> hibernate-core 3.6.1
        force: true

根据您选择的版本替换版本号。标志 force 应覆盖Play

使用的默认值

修改

您可能需要指向JBoss存储库,请参阅Stephano的评论:

  

我严格遵循播放依赖关系maven2的例子并添加了   org.jboss - > * AND org.jboss.javaee - > *并且完美地运作

答案 1 :(得分:1)

感谢Pere Villegas的回答,我找到了通过播放更新Hibernate的解决方案:

require:
    - play
    - org.hibernate -> hibernate-core 3.6.9.Final:
        force: true
    - org.hibernate -> hibernate-validator 4.2.0.Final

repositories:
    - jboss:
        type: iBiblio
        root: "https://repository.jboss.org/nexus/content/groups/public"
        contains:
            - org.jboss -> *
            - org.jboss.javaee -> *
            - org.hibernate -> *  

答案 2 :(得分:0)

似乎Play带有开箱即用的hibernate,但它没有任何强大的依赖关系,所以你应该能够只替换hibernate库。

请参阅Play without JPA/Hibernate?中的Play framework google group

我不是专家,所以我会在清单上确认一下。