5.3.2 External Configuration Support - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
5.3.2 External Configuration Support
Some deployments require that configuration be sourced from more than one place and be changeable without requiring a rebuild of the application. In order to support deployment scenarios such as these the configuration can be externalized. To do so, point Griffon at the locations of the configuration files that should be used by adding agriffon.config.locations
setting in Config.groovy
, for example:griffon.config.locations = [ "classpath:${appName}-config.properties", "classpath:${appName}-config.groovy", "file:${userHome}/.griffon/${appName}-config.properties", "file:${userHome}/.griffon/${appName}-config.groovy"]
USER_HOME
.It is also possible to load config by specifying a class that is a config script.griffon.config.locations = [com.my.app.MyConfig]
config
property of the GriffonApplication object and are hence obtainable from there.Values that have the same name as previously defined values will overwrite the existing values, and the pointed to configuration sources are loaded in the order in which they are defined.