这是一个有效的用例,但是,
HttpClientProperties由于组件扫描程序未扫描您的用户,因此未将他们接走。您可以使用来注释您
HttpClientProperties的
@Component:
@Validated@Component@ConfigurationProperties(prefix = "plugin.httpclient")public class HttpClientProperties { // ...}这样做的另一种方法(如StephaneNicoll所述是通过
@EnableConfigurationProperties()在Spring配置类上使用注释,例如:
@EnableConfigurationProperties(HttpClientProperties.class) // This is the recommended way@EnableSchedulingpublic class HttpClientConfiguration { // ...}


