The Spring Boot documentation says that to use the @ConfigurationProperties
annotation
You also need to list the properties classes to regis
It took me a while to reach to this post but would like to add here so that others may get benefited.
@ConfigurationProperties
- Used to bind a class with an externalized property file. Very powerful and must be used to separate out bean classes with configuration entity class.
@Configuration
- Creates a Spring bean of configuration stereotype.
@EnableConfigurationProperties
- Creates a binding between a configuration entity class and Spring configuration stereotype so that after injection within a service properties can be retrieved easily.