I have what I believe is a common use case for developing and deploying a Play 2.3.6 application:
- In development, I run
sbt run, and the application uses application.confas expected. - During the creation process, I would like to use
sbt startand specify the configuration file production.conf, which is located in the same directory as the dev configuration file (which is located <project root>/conf/)
Following the instructions in the "Specifying an Alternate Configuration File" section of the official documentation page , complete the following steps:
$ sbt start -Dconfig.file=/full/path/to/project/conf/production.conf
The application starts without errors, but I can check the web application and see that it loads the development values application.conf, not my production values found in production.conf.
I also tried the suggested approach:
$ sbt start -Dconfig.resource=production.conf
And the server does not start with an error:
[error] com.typesafe.config.ConfigException$IO: production.conf: java.io.IOException: resource not found on classpath: production.conf
Has anyone else figured out how to do this correctly?
source
share