Merging multiple TypeSafe Config files and resolving only after they are all merged

The answer is to use ConfigFactory.parseResource() in place of ConfigFactory.load().

Here is the finished result

private lazy val defaultConfig     = ConfigFactory.parseResources("conf/env/default.conf")
private lazy val environmentConfig = ConfigFactory.parseResources("conf/env/" + env + ".conf" )
private lazy val userConfig        = ConfigFactory.parseResources("application.conf")
private lazy val config = ConfigFactory.load()
                          .withFallback(userConfig)
                          .withFallback(environmentConfig)
                          .withFallback(defaultConfig)
                          .resolve()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)