You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using -Dconfig.resource
This will search for an alternative configuration file in the application classpath (you usually provide
these alternative configuration files into your application conf/ directory before packaging). Play will look into conf/ so you don’t have to add conf/.
Play applications created by gradle embed all conf/ files in the application jar and will only load config files from the classpath. This is not consistent with the documentation and gets even more confusing since config files are also packaged in the conf/ directory but ignored when running the application.
Looking at applications built by sbt the layout is different. Files from conf/ are not packaed inside jars but the launcher jar has a Class-Path entry in the manifest.mf that add the conf/ directory to the class path:
Just a note: Play 2.8.0 had a bug where reading config.file/config.resource from devSettings and sys properties wasn't working. Fixed in Play 2.8.1. playframework/playframework#10010
The play documentation on https://www.playframework.com/documentation/2.6.x/ProductionConfiguration states:
Play applications created by gradle embed all conf/ files in the application jar and will only load config files from the classpath. This is not consistent with the documentation and gets even more confusing since config files are also packaged in the conf/ directory but ignored when running the application.
Looking at applications built by sbt the layout is different. Files from conf/ are not packaed inside jars but the launcher jar has a Class-Path entry in the manifest.mf that add the conf/ directory to the class path:
Class-Path: ../conf/ my-application.jar dependencies.jar...
As a work-around, the same behavior can be achieved by including the following snippet in the build file:
The text was updated successfully, but these errors were encountered: