The Spring Boot documentation says that to use the @ConfigurationProperties
annotation
You also need to list the properties classes to regis
If we look at the code below:
@Configuration @EnableConfigurationProperties @ConfigurationProperties(prefix="ar1")
public class ar1Settings { }
@Configuration tells Spring to treat this as a configuration class and register it as a Bean
@EnableConfigurationProperties tells Spring to treat this class as a consumer of application.yml/properties values
@ConfigurationProperties tells Spring what section this class represents.
My understanding is that if you don't need to specify the section of the property file, then @ConfigurationProperties can be omitted.