spring 添加组件web
1).引入组件引用spring
2).配置组件beantomcat
3).配置基本参数spring-boot
参照这个思路,spring boot starter 如何自动配置组件spa
1.在 xxx-spring-boot-autoconfigure 中添加相关以来pom引用对象
2.在XxxAutoConfiguration类中添加组件beanio
3.XxxAutoConfiguration中绑定配置对象(基本配置参数)容器
注意:须要在META-INF/spring.factories文件中添加XxxAutoConfiguration,spring在容器准备阶段会将其添加到组件中配置
1.写一个xxx-spring-boot-autoconfigure 项目,添加了依赖以及自动配置相关信息,依赖spring默认自动配置spring-boot-autoconfigure引用
2.写一个xxx-spring-boot-starter 经过这个项目暴露,经过添加该项目依赖将功能组件添加到spring boot中
3.spring boot 提供的autoconfig 结构,全部的自提供的autoconfig都在spring-boot-autoconfigure 中,经过starter引用暴露,全部的spring boot 提供的组件头经过引用starter来获取自动配置
4.内置tomcat 组件在web中
5.logger 在底层,在starter中