Config files for Grails Plugin

20 views
Skip to first unread message

clr meno

unread,
Apr 3, 2017, 6:22:50 PM4/3/17
to Grails Dev Discuss
I have many service and src files that are common for  different applications (uses Grails 2.4.4) . So I converted them to plugins. But I am having to repeat the configurations of Datasource.groovy, BuildConfig.groovy and Config.groovy in each of these plugins and the main applications to avoid any compilation erorr and to have the plugin build successfully. Is there a better way to share the config files between plugins and main application instead of duplicating it everywhere?

clr meno

unread,
Apr 4, 2017, 10:48:00 AM4/4/17
to Grails Dev Discuss
Is it possible to Include BuildConfig in the plugin install so that same BuildConfig configuration need not be duplicated in the host  application that uses the plugin

clr meno

unread,
Apr 4, 2017, 7:21:38 PM4/4/17
to Grails Dev Discuss
Yes. The dependencies and Plugins configured in the BuildConfig.groovy of each of the plugins got merged to the main application without any additional configuration.

Chris Malan

unread,
Apr 5, 2017, 2:32:39 AM4/5/17
to Grails Dev Discuss


On Tuesday, April 4, 2017 at 8:22:50 AM UTC+10, clr meno wrote:
I have many service and src files that are common for  different applications (uses Grails 2.4.4) . So I converted them to plugins. But I am having to repeat the configurations of Datasource.groovy, BuildConfig.groovy and Config.groovy in each of these plugins and the main applications to avoid any compilation erorr and to have the plugin build successfully. Is there a better way to share the config files between plugins and main application instead of duplicating it everywhere?

 As it seems you said yourself, it's possible.  Here's how it's done in Grails 3: http://www.databaseapplications.com.au/grails-multi-app.jsp  Look under the 'Keeping Things DRY' heading.  

Reply all
Reply to author
Forward
0 new messages