I am loading settings from a YAML file and having Spring autowire the results in a Properties
bean like so:
@ConfigurationProperties(prefix = "myPrefix")
@Bean
private Properties getProperties() {
return new Properties();
}
However, the Properties
class is rather limiting, and I would like to have an Apache commons config Configuration
object. The commons config documentation says that it can be integrated with Spring, but I don't see an example for this simple use case.
How can I autowire an apache commons Configuration
in Spring Boot?