A kotlin data class in a library A for config immutable properties (all property set to val not var):
data class Cfg(
val name: String,
...
)
Since spring boot 2.2.0, can use the bellow code to config a single but fixed prefix:
@ConstructorBinding
@ConfigurationProperties(prefix = "app.cfg")
data class Cfg(...)
My app depends on the library A, but need to config multiple Cfg instance with different prefix, such as app.cfg1 and app.cfg2. And these prefixes is chosen by the app. How?