-
Notifications
You must be signed in to change notification settings - Fork 978
Open
Description
Starting from 1.4.1 this code behaves differently then previously:
ConfigFactory.systemEnvironmentOverrides().withFallback(ConfigFactory.systemProperties)
Here's the simple test. Run this application with environment variable VARIABLE
set to any String
import com.typesafe.config.ConfigFactory
//VARIABLE=test
object Test extends App {
val env = ConfigFactory.systemEnvironmentOverrides().withFallback(ConfigFactory.systemProperties)
println(env.getString("VARIABLE"))
}
implementation('com.typesafe:config:1.4.0')
Output:
> Task :Test.main()
test
implementation('com.typesafe:config:1.4.1')
Output
> Task :Test.main() FAILED
Exception in thread "main" com.typesafe.config.ConfigException$Missing: system properties: No configuration setting found for key 'VARIABLE'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:157)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:175)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:194)
at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:251)
at Test$.delayedEndpoint$Test$1(Test.scala:6)
at Test$delayedInit$body.apply(Test.scala:3)
at scala.Function0.apply$mcV$sp(Function0.scala:42)
at scala.Function0.apply$mcV$sp$(Function0.scala:42)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$1(App.scala:98)
at scala.App.$anonfun$main$1$adapted(App.scala:98)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:575)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:573)
at scala.collection.AbstractIterable.foreach(Iterable.scala:933)
at scala.App.main(App.scala:98)
at scala.App.main$(App.scala:96)
at Test$.main(Test.scala:3)
at Test.main(Test.scala)
I've printed config as well and made a text search for VARIABLE
and indeed no such variable there.
andreezy777, kromuch and VGAngel
Metadata
Metadata
Assignees
Labels
No labels