Search code examples
scalasbtsbt-native-packager

Config file include issue with sbt native packager


In our project we use multiple configuration files to manage app configurations. application.conf has #include "file.conf" to accomplish it. All files are in the same universal/conf/ folder.

When I try to run application after sbt stage, application fails to find configurations in other conf files except than application.conf

No configuration setting found for key 'kafka'
com.typesafe.config.ConfigException$Missing

It looks like path issue. How can I solve it? Or what's best practice to manage configuration files?


Solution

  • If all your config files are correctly in /conf, then this is not a native packager issue.

    I assume you are using the playframework. By default play looks for an application.conf. Under the hood play uses the Typesafe Config, which provides multiple ways to override the configuration source. One is to set the resource name

    config.resource=file.conf