就说下run的流程主要是
- new SpringApplication 同时确定是Servlet项目还是REACTIVE响应式。
- 开始处理Spring 容器。
2.1 创建个ConfigurableApplicationContext
2.2 refreshContext,这里就把BeanDefinition注入,还有自动吧bean也注入到Spring容器。Spring Boot是启动时自动注入bean的,Spring是等第一次调用getBean的。
2.3 调用自定义的listeners、Runners。
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
public @interface SpringBootApplication {
主要的@EnableAutoConfiguration
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@documented
@Inherited
@AutoConfigurationPackage
@import(AutoConfigurationimportSelector.class)
public @interface EnableAutoConfiguration {



