<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          mica-autospring boot stater 開發(fā)利器

          聯(lián)合創(chuàng)作 · 2023-09-28 05:26

          mica-auto spring boot stater 開發(fā)利器

          mica-auto 是 Spring cloud 微服務(wù)框架 Mica 中的一個(gè)基礎(chǔ)組件,用來生成 Spring boot 的一些基礎(chǔ)配置。

          功能

          1. 生成 spring.factories

          2. 生成 spring-devtools.properties

          3. 生成 FeignClient 到 spring.factories 中,供 mica 中完成 Feign 自動化配置。

          使用

          注意: 如果你項(xiàng)目中使用了 Lombok 請將 mica-auto 的依賴放置到 Lombok 后面。

          maven

          <dependency>
            <groupId>net.dreamlu</groupId>
            <artifactId>mica-auto</artifactId>
            <version>2.0.3</version>
            <scope>provided</scope>
          </dependency>

          gradle >= 5.x

          annotationProcessor("net.dreamlu:mica-auto:2.0.3")

          gradle < 5.x

          compileOnly "net.dreamlu:mica-auto:2.0.3"

          原理

          掃描 @Configuration,自動生成相應(yīng)的配置。

          初衷

          在編寫 Spring boot 相關(guān)插件的時(shí)候經(jīng)常需要編寫和修改 spring.factories 文件,其中有一次忘記修改,導(dǎo)致服務(wù)啟動報(bào)錯(cuò)。想到編譯期間自動生成這種配置。

          注解 spring.factories 或 Spi key
          @AutoContextInitializer ApplicationContextInitializer
          @AutoListener ApplicationListener
          @AutoRunListener SpringApplicationRunListener
          @AutoEnvPostProcessor EnvironmentPostProcessor
          @AutoFailureAnalyzer FailureAnalyzer
          @AutoConfigImportFilter AutoConfigurationImportFilter
          @AutoTemplateProvider TemplateAvailabilityProvider
          @AutoEnableCircuitBreaker EnableCircuitBreaker
          @AutoConfigDataLocationResolver ConfigDataLocationResolver
          @AutoConfigDataLoader ConfigDataLoader
          @Component EnableAutoConfiguration
          @AutoIgnore 忽略,不生成到 spring.factories
          @AutoService java Spi 生成配置

          開源協(xié)議

          LGPL(GNU Lesser General Public License

          參考

          Google Auto: https://github.com/google/auto

          Spring 5 - spring-context-indexer:https://github.com/spring-projects/spring-framework/tree/master/spring-context-indexer

          瀏覽 19
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  中文字幕三级视频 | 国产精品 A片在线 | 免费a在线| 九九九九九九九九九九九精品 | 三级片在线一区 |