在SpringBoot中,每一个自动配置类结合相应的属性配置类,读取配置文件,进行自动配置功能。
其中,属性配置类来自于被@EnableConfigurationProperties注解所标识xxxProperties.class,配置文件一般为该jar包下的META-INF/spring.factories。
以 Web 服务器配置为例,其配置类为ServletWebServerFactoryAutoConfiguration,该类结合ServerProperties.class读取配置文件,并进行自动配置功能。
其属性配置类来自于被@EnableConfigurationProperties注解所标识的ServerProperties.class,配置文件一般为包下的META-INF/spring.factories。