参考spring-boot-starter原理及实现方法
定义pom文件spring-boot-starter打包注意 jar-no-fork
config 配置4.0.0 org.springframework.boot spring-boot-starter-parent2.1.4.RELEASE com.ouyanglol starter-demo0.0.1-SNAPSHOT starter-demo spring-boot-starter demo 1.8 org.springframework.boot spring-boot-starterorg.springframework.boot spring-boot-configuration-processortrue org.projectlombok lomboktrue org.springframework.boot spring-boot-starter-testtest org.apache.maven.plugins maven-source-pluginpackage jar-no-fork
读取配置,@ConfigurationProperties,自定义配置
enableXXX开启使用stater入口定义annotation 定义开启stater的注解,通过@ConditionalOnBean绑定
定义自动配置定义一个类,如: DemoAutoConfiguration
引入自定义stater的业务逻辑,引入service等@ConditionalOnBean 开启使用条件@EnableConfigurationProperties(xxx) 使用自定义配置类,
在resources/meta-INF/下创建spring.factories文件
告诉spring需要加载的类
org.springframework.boot.autoconfigure.EnableAutoConfiguration= com.ouyanglol.starterdemo.config.DemoAutoConfiguration



