Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local application.conf with Play 1.2.5?

Is there a possibility to use a local application.conf with Play 1.2.5? Our problem is that different developers have somewhat different setups that we don't want to save to version control.

Alternatives found:

  • Just modifying application.conf
    • Have to be careful not to commit changes to VCS
  • Environments : Own environment for each developer : %john, %mary (saved to VCS)
    • OK alternative, even though we woudn't like to save those to version control
    • We have do change those during development every now and then -> would cause unnecessary changes
  • @include : application.conf option for additional configuration files
    • Play 1.2.5 documentation : This is an experimental feature that does not yet work properly. :(

Something else?

Especially, is there a way to tell Play to use custom file name (as "conf/application.conf.local" instead of default "conf/application.conf"?

like image 768
Touko Avatar asked Jan 30 '13 10:01

Touko


3 Answers

You can append:

%[email protected]=my_application.conf

At the end of application.conf. One line per developer or environment. You can override some properties in my_application.conf and is not necesary to prepend %my_play_id to the properties changed. For example if you have three developers:

%[email protected]=developer1_conf.conf
%[email protected]=developer2_conf.conf
%[email protected]=developer3_conf.conf
like image 53
Alonso Avatar answered Sep 29 '22 18:09

Alonso


I have looked at the Play! 1.2.5 source code, but find nothing that suggests that Play! would be able to pick up anything other than the file conf/application.conf.

like image 24
Werner Kvalem Vesterås Avatar answered Sep 29 '22 17:09

Werner Kvalem Vesterås


I just encountered Play 1.x module externalconfig that could help. Seems to work for our purposes. As an extra, this helps to keep production passwords etc out from the VCS.

Note that this module works only within Play's Java code - Play modules implemented in Python (as migrate, for example) won't be aware of external configuration. There might be concerns also with other Java modules that rely on onConfigurationRead().

like image 25
Touko Avatar answered Sep 29 '22 18:09

Touko