Play 2.6.x Scala
I have a default application.conf
within the folder {project}/conf/
but I'd like to override some values depending on the environment by passing in the respective file as command-line arguments (as detailed in the docs):
sbt run -Dconfig.file=/conf/qa.conf
or sbt run -Dconfig.resource=qa.conf
But I'm not able to get play to pick up the overrides. Here's my file directory:
application
|- playApp1
|- playApp2
|-- conf
|-- application.conf
|-- qa.conf
My build.sbt
makes playApp2 the default project on load. And I have confirmed that the defulat application.conf
is working -- just the override is not.
Thanks for any ideas!
--
Update
Here are the HOCON files play uses. application.conf
platform {
scheme = "http"
host = "localhost:8080"
}
and the overrides as provided in qa.conf
include "application.conf"
platform {
scheme = "https"
host = "ea311.34.com"
}
This works if you provide the command line argument first
Your question is about HOCON, in case you did not realize it.
Without seeing your
application.conf
I can only provide a generic answer. Here is an example of providing a default value forakka.log-config-on-start
, which will be overridden by a Java system property or an environment variable calledCONFIG_DUMP
, if defined:This feature of HOCON is documented here.