sbttypesafetypesafe-config

How do you override Typesafe Config settings?


In my application.conf file I have something like

platform3.operational.state = "development"

I run my service with

sbt "project p3-s-sink" "run -Dplatform3.operational.state=test"

But the configuration property is still "development"

How do you override typesafe-config settings?


Solution

  • Maybe this blog helps you:

    Unfortunately sbt run doesn’t support java system properties so you can’t tweak settings with the command line when running sbt. The sbt-revolver plugin, which allows you to run your app in a forked JVM, does allow you to pass java arguments using the command line.

    http://blog.michaelhamrah.com/2014/02/leveraging-typesafes-config-library-across-environments/