## 3.4 Externalized Configuration

The default configuration file `Config.groovy` in `grails-app/conf` is fine in the majority of cases, but there may be circumstances where you want to maintain the configuration in a file outside the main application structure. For example if you are deploying to a WAR some administrators prefer the configuration of the application to be externalized to avoid having to re-package the WAR due to a change of configuration.

In order to support deployment scenarios such as these the configuration can be externalized. To do so you need to point Grails at the locations of the configuration files Grails should be using by adding a `grails.config.locations` setting in `Config.groovy`:

    grails.config.locations = [ "classpath:${appName}-config.properties",
                                "classpath:${appName}-config.groovy",
                                "file:${userHome}/.grails/${appName}-config.properties",
                                "file:${userHome}/.grails/${appName}-config.groovy"]

In the above example we're loading configuration files (both Java properties files and ConfigSlurper configurations) from different places on the classpath and files located in `USER_HOME`.

Ultimately all configuration files get merged into the `config` property of the api:org.codehaus.groovy.grails.commons.GrailsApplication object and are hence obtainable from there.

> Grails also supports the concept of property place holders and property override configurers as defined in Spring For more information on these see the section on Grails and Spring