Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework config include breaks with dist

We have a complex application built using the play framework. The application is divided into distinct parts. The website, the crawlers and all the others use similar classes and configuration files. To remedy with that, we centralized these into a folder at the root of the play application.

In development, the import statement for the classes and the include statement, to load multiple config files, work fine. In production, we used to deploy the dist version of the code, but the includes, which all have relative paths, stopped to work.

We tried -Dconfig.file to load the parent. That file was added to the generated zip folder, but the included files were no where to be found.

Would anyone have an idea on how to "compile" or centralize the config files for play to load them all ?

Thank you for your help.

like image 346
Philippe Avatar asked Feb 27 '26 03:02

Philippe


1 Answers

I had the same issue, I found that I had to specify the full path for the -Dconfig.file so the include part in it would work.

i.e.

/path/to/dir -->
     production.conf = {include "application.conf" and some overrides}
     start
     my-app/

./start -Dconfig.file=/path/to/dir/production.conf

edit in play 2.2 the distributable zip structure changed, there's now a bin dir with the app name script in it, so:

    /path/to/dir -->
     production.conf = {include "application.conf" and some overrides}
     bin/my-app

     ./bin/my-app -Dconfig.file=/path/to/dir/production.conf
like image 135
LiorH Avatar answered Mar 01 '26 20:03

LiorH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!