I have a properties class defined like this:
@Validated
@ConfigurationProperties(prefix = \"plugin.httpclient\")
public class HttpClientProperties {
...
}
This is a valid use case, however, your HttpClientProperties are not picked up because they're not scanned by the component scanner. You could annotate your HttpClientProperties with @Component:
@Validated
@Component
@ConfigurationProperties(prefix = "plugin.httpclient")
public class HttpClientProperties {
// ...
}
Another way of doing so (as mentioned by Stephane Nicoll) is by using the @EnableConfigurationProperties() annotation on a Spring configuration class, for example:
@EnableConfigurationProperties(HttpClientProperties.class) // This is the recommended way
@EnableScheduling
public class HttpClientConfiguration {
// ...
}
This is also described in the Spring boot docs.