Search code examples
hibernategrailsgrails-ormgrails-3.1

How can I remove hibernate in grails 3.x?


The command recommended by this SO question does not exist for grails 3.1.x Can I configure Grails with no datasource?

grails uninstall-plugin hibernate
| Error Command not found uninstall-plugin

The grails app in question needs no persistence, and I'm trying to reduce the memory footprint. Looking for an answer that applies to grails 3.1.x or newer.


Solution

  • To remove all hibernate all you need to do is remove any hibernate dependencies from build.gradle you do not want/need.

    Eg: remove these (as of 3.2.8)

    buildScript:

    classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
    

    dependancies:

    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:$hibernateVersion"
    compile "org.hibernate:hibernate-ehcache:$hibernateVersion"
    

    You may also use the CLI grails create-app --features ... and not include hibernate as a feature, only the features you want.