How can I remove hibernate in grails 3.x?

646 views Asked by At

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.

2

There are 2 answers

0
erichelgeson On BEST ANSWER

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.

0
Todd Sharp On

Remove the dependency from your application.yml.

As an aside, if you don't need persistence have you looked at using Spark Java instead of Grails? It's super lightweight and you can easily use Groovy with it.