scala - play2 selectively override settings in application.conf for the run task -


in production play projects can selectively override settings adding application.conf classpath. not seem work development run task. useful different developers test/work different settings without affecting versioned file.

in non-play scala project uses typesefe-config can adding additional application.conf in sbt config:

unmanagedclasspath in runtime ++= sys.env.get("custom_config").map(ec=>attributed.blank(file(ec))).toseq 

this way each developer can have own override. play run task doesn't seem honor thought according sbt inspect depends on runtime:unamanagedclasspath setting.

you can of course provide complete replacement application.conf not override few entries.

anyone knows how this?

create new config file: /my/local.conf

within file:

include "application.conf"  my.custom.setting="hello" 

the first line references application.conf within classpath. succeeding line adds/overrides settings.

you start with:

sbt -dconfig.file=/my/local.conf ~run 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -