(Quick Reference) # 4.1.1 Options for the YML format Config Version: 6.0.0 ## 4.1.1 Options for the YML format Config 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:
    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` is used to start the application
    bootRun {
        systemProperties = System.properties
    }
For testing the following will need to change the `test` task as follows
    test {
        systemProperties = System.properties
    }
### External configuration Grails will read `application.(properties|yml)` from the `./config` or the current directory by default. As Grails is a SpringBoot configuration options are available as well, for documentation please consult: https://docs.spring.io/spring-boot/docs/2.7.12/reference/html/features.html#features.external-config.files | Quick Reference (hide)