Change default config file in grails

03 / Jun / 2015 by neetu.nandwani 0 comments

I was going through Grails documentation and found one interesting fact that I would like to share. As we already know that grails configuration can be externalised using


grails.config.locations = ['path to external config file']

Any config defined in this external config will override the value defined in Config.groovy.

It might be possible that we want to have default value fetched from some other config files which can be overridden in Config.groovy, In that case add this property to Config.groovy


grails.config.defaults.locations = ['path to your external/default config file']

The config described by grails.config.defaults.locations will be loaded before all other values and can therefore be overridden.

Here is the link to documentation.

Tag -

FOUND THIS USEFUL? SHARE IT

Leave a comment -