Reputation: 31546
I am reading some code which uses typesafe config to read the application.conf
file in the resource folder. I am using a library which has a application.conf
in its resource folder and I call this library from another project which has its own application.conf
in its resources folder.
Will typesafe config be able to read the right config files respectively?
Upvotes: 2
Views: 722
Reputation: 170733
From documentation:
So, both libraries will see the same Config
, which is the result of merging both application.conf
(assuming both use default behavior and there are no more application.conf
or reference.conf
files on the classpath). Each library should not just put its configuration in the root, but instead have its own part of config tree: i.e. not
debug = true
server = "example.com"
but
my.cool.library {
debug = true
server = "example.com"
}
If this rule is followed, the libraries won't conflict. If they use the same path with different meaning, you will have trouble.
Upvotes: 3