////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

The `application.yml` file was introduced in Grails 3.0, and YAML is now the preferred format for configuration files.


=== Using system properties / command line arguments


Suppose you are using the `JDBC_CONNECTION_STRING` command line argument and you want to access the same in the yml file then it can be done in the following manner:

[source,yaml]
----
production:
    dataSource: 
        url: '${JDBC_CONNECTION_STRING}'
----

Similarly system arguments can be accessed.

You will need to have this in `build.gradle` to modify the `bootRun` target if `grails run-app` or `./gradlew bootRun` is used to start the application

[source,groovy]
----
bootRun {
    systemProperties = System.properties
}
----

For testing the following will need to change the `test` task as follows

[source,groovy]
----
test { 
    systemProperties = System.properties 
}
----

=== Default Configuration

Grails will read `application.(properties|yml)` from the `./config` or the current directory by default.
