mica-auto
是 Spring cloud
微服務框架 Mica
中的一個基礎組件,用來生成 Spring boot starter
的一些基礎配置。html
版本更新記錄:https://github.com/lets-mica/mica-auto/blob/master/CHANGELOG.md
最新版本:https://mvnrepository.com/artifact/net.dreamlu/mica-autogit
主要是用來避免 Spring boot 主項目包同 子項目
或者子模塊
包不一致,避免包掃描不到的問題。github
spring boot starter
。子項目
(不建議主項目添加 mica-auto
)。spring.factories
spring-devtools.properties
FeignClient
到 spring.factories
中,供 mica-pro
中完成 Feign
自動化配置。注意:
若是你項目中使用了 Lombok
請將 mica-auto
的依賴放置到 Lombok
後面。spring
<dependency> <groupId>net.dreamlu</groupId> <artifactId>mica-auto</artifactId> <version>${version}</version> <scope>provided</scope> </dependency>
annotationProcessor("net.dreamlu:mica-auto:${version}")
compileOnly "net.dreamlu:mica-auto:${version}"
當執行 mvn package
或者 gradle build
時 就會生成相關配置。框架
掃描 @Component
,自動生成相應的配置,支持組合註解。maven
LGPL(GNU Lesser General Public License)ide
Google Auto: https://github.com/google/auto微服務
Spring 5 - spring-context-indexer:https://github.com/spring-projects/spring-framework/tree/master/spring-context-indexergradle