ticofab
ticofab

Reputation: 7717

Play Framework - debug & release configurations?

When developing a Play application, we use the standard configuration file in conf/application.conf. How can I use different conf files depending on whether I'm in debug or release mode?

Upvotes: 0

Views: 101

Answers (1)

bjfletcher
bjfletcher

Reputation: 11518

Let's say you have prod.conf and debug.conf both in the conf folder, you can add the following system property:

-Dconfig.resource=(prod|debug).conf

if the files can't be packaged in the app in the conf folder and have to be external, for example, in /opt/conf, then you can add the following instead:

-Dconfig.file=/opt/conf/(prod|debug).conf

They can inherit a common configuration file and override values:

include "application.conf"
key.to.override=blah

See reference for more on this.

Upvotes: 2

Related Questions