A Grails app I’m working on is becoming pretty big, and it would be good to refactor it into several modules, so that we don’t have to redeploy the whole thing every time.
What is the best practice to split a Grails app in several modules?
In particular I’d like to create a package of domain classes + relevant services and use it in the app as a module. Is this possible? Is it possible to do it with plugins?
that’s what plugins are for. In case of splitting up a large app into several modules, using the “inline plugin” feature is extremly useful. Just add
to your app’s
grails-app/conf/BuildConfig.groovy. By doing so, you no longer have to runpackage-pluginandinstall-pluginafter every modification inside a plugin.For details on using plugins, see Grails reference docs, or one of the available books: “Definitive Guide to Grails” or “Grails in Action”. Both are absolutely worth their costs.