spring boot 启动流程 Created with Raphaël 2.1.2 构造SpringApplication 启动SpringApplication 从Spring容器中找出ApplicationRunner和CommandLineRunner接口的实现类并排序后依次执行 构造SpringApplication Created with Raphaël 2.1.2 设置启动配置参数 启动SpringApplication 设置Environment 找出所有的initializers 找出所有的listeners 找到main class run 启动SpringApplication Created with Raphaël 2.1.2 run 监听run方法的执行,封装成事件广播出去 根据Environment构造上下文对象 用前面的initializers初始化Spring容器 Spring容器的刷新 从Spring容器中找出ApplicationRunner和CommandLineRunner接口的实现类并排序后依次执行 run