zoukankan      html  css  js  c++  java
  • SpringBoot-自定义Starter

    步骤

    创建xxxAutoConfiguration类
    添加@Configuration注解修饰
    添加@Conditionalxxx注解做注入条件判断
    添加@AutoConfigureOrder注解注入顺序
    添加@AutoConfigureAfter注解注入后操作
    
    创建xxxProperties配置类
    添加@ConfigurationProperties注解映射相关配置
    
    xxxAutoConfiguration类添加@EnableConfigurationProperties注入配置类
    
    参考WebMvcAutoConfiguration等自动注入类
    

    模式

    xxx-spring-boot-starter只用来做依赖导入(POM项目)
    xxx-spring-boot-autoconfigure核心应用项目
    第三方只需引入xxx-spring-boot-starter依赖即可

    参考mybatis-spring-boot-starter

      

      

  • 相关阅读:
    debounce
    react-xiguan
    备忘录
    ie导出问题
    umi 动态路由配置
    tsconfig
    关于vue 和react 中的hash与锚点冲突问题
    lodash
    pyplot绘图
    Numpy实现图像变换
  • 原文地址:https://www.cnblogs.com/BINGJJFLY/p/12040453.html
Copyright © 2011-2022 走看看