I have config variable(in application.yml) as:
xyz:
exception.emails: ['[email protected]']
While fetching this in local works fine but after deploying war I am getting config variable as:
xyz: [
exception: [
emails[
0
]: [email protected]
]
]
I am pulling this as:
def email = Holders.config.grails.xyz.exception.emails
I'm actually surprised this work at all, because I don't think that is proper yml syntax looking at the default application.yml they specify a list of userAgents like this:
Personally I like to use an application.groovy and use groovy syntax like this:
It maybe a little out of date but here is an example of a application.yml converted to application.groovy: https://github.com/virtualdogbert/Grails3Tutorial/blob/step_01_settings_yml_to_groovy/grails-app/conf/application.groovy
Also note in the past you could run code from application.groovy, however if you have any imports they won't work,because application.yml/groovy, is meant for the cli(pre runtime), so as a workaround you can also specify a runtime.groovy, where you can have imports. If you ever go the extra mile and write a plugin, you can specify a plugin.groovy, to set defaults.