{"id":20546,"date":"2015-06-03T12:47:42","date_gmt":"2015-06-03T07:17:42","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=20546"},"modified":"2015-06-03T17:43:54","modified_gmt":"2015-06-03T12:13:54","slug":"change-default-config-file-in-grails","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/change-default-config-file-in-grails\/","title":{"rendered":"Change default config file in grails"},"content":{"rendered":"<p>I was going through\u00a0Grails documentation and found one interesting fact that I would like to share. As we already know that grails configuration can be externalised using<\/p>\n<p>[code]<\/p>\n<p>grails.config.locations = [&#8216;path to external config file&#8217;]<\/p>\n<p>[\/code]<\/p>\n<p>Any config defined in this external\u00a0config will override the value defined in Config.groovy.<\/p>\n<p>It might be possible that\u00a0we 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<\/p>\n<p>[code]<\/p>\n<p>grails.config.defaults.locations = [&#8216;path to your external\/default config file&#8217;]<\/p>\n<p>[\/code]<\/p>\n<p>The config described by grails.config.defaults.locations will be loaded before all other values and can therefore be overridden.<\/p>\n<p><a title=\"http:\/\/grails.github.io\/grails-doc\/2.4.4\/guide\/single.html#configExternalized\" href=\"http:\/\/grails.github.io\/grails-doc\/2.4.4\/guide\/single.html#configExternalized\" target=\"_blank\">Here<\/a> is the link to documentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was going through\u00a0Grails documentation and found one interesting fact that I would like to share. As we already know that grails configuration can be externalised using [code] grails.config.locations = [&#8216;path to external config file&#8217;] [\/code] Any config defined in this external\u00a0config will override the value defined in Config.groovy. It might be possible that\u00a0we want [&hellip;]<\/p>\n","protected":false},"author":104,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":8},"categories":[7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20546"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=20546"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20546\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=20546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=20546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=20546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}