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