How to configure Grails 3.1.1 to use Hibernate 5

前端 未结 2 419
长发绾君心
长发绾君心 2020-12-12 00:43

How do I make Grails 3.1.1 user Hibernate 5?

The following actions report Hibernate version 4.3.11.Final: In Grails 3.1.1

  1. grails create-app hello311
2条回答
  •  忘掉有多难
    2020-12-12 01:24

    In build.gradle change the classpath dependency for the hibernate4 plugin at the top of the file in the buildscript{ dependencies {... section as follows:

    classpath "org.grails.plugins:hibernate5:5.0.1"
    

    The classpath section is there for the Gradle scrips like schemaExport, and that section does not support auto versioning.

    Change the compile hibernate4 plugin dependency to the following:

    compile "org.grails.plugins:hibernate5"
    

    Add the following hibernate-core dependency:

    compile "org.hibernate:hibernate-core:5.0.7.Final"
    

    Change the hibernate-ehcache dependency to the 5.0.7.Final version.

    compile "org.hibernate:hibernate-ehcache:5.0.7.Final"
    

提交回复
热议问题