I'm running Grails 2.1.1, and i'm looking for a way to get the value of variable set in production while i'm running on test environment. The config file :
development {
config.url = "http://local"
}
test {
config.url = "http://test.lan"
}
production {
config.url = "http://prod.lan"
}
The only way i know to get config variables is grailsApplication.config.url
The standard config setup only looks at the current environment.
Holdershas the same current config asgrailsApplication. You have to slurp the config again. Try usingConfigurationHelper. A spock test is below. (Note the sometimes doubledconfig.configis because the firstconfigis the property (or short name forgetConfig()method) and your key contains the secondconfig.)