All Projects → lets-mica → mica-auto

lets-mica / mica-auto

Licence: LGPL-3.0 license
mica-auto 使用注解自动生成 java spi 和 Spring boot 的配置。🔝🔝 记得右上角点个star 关注更新!

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to mica-auto

spring-cloud-marathon
Spring Cloud integration with Mesos and Marathon
Stars: ✭ 29 (-76.23%)
Mutual labels:  spring-cloud
spring-petclinic-microservices
Distributed version of Spring Petclinic built with Spring Cloud
Stars: ✭ 55 (-54.92%)
Mutual labels:  spring-cloud
social-network
Microservices project
Stars: ✭ 39 (-68.03%)
Mutual labels:  spring-cloud
go-register-server
The microservice registration is implemented by monitoring the state changes of the k8s pod, and pull the interface in the spring cloud eureka client service list.
Stars: ✭ 14 (-88.52%)
Mutual labels:  spring-cloud
spring-cloud-repository
spring-cloud学习的demo记录
Stars: ✭ 26 (-78.69%)
Mutual labels:  spring-cloud
spring-interview-questions
500+ Spring-Boot Interview Questions
Stars: ✭ 269 (+120.49%)
Mutual labels:  spring-cloud
robert
基于SpringCloud的企业级微服务多租户系统、多语言的脚手架, 代码组件化、高内聚低耦合,代码简介,注释丰富容易上手,该项目包括用于开发分布式应用程序服务的必要组件,支持多应用程序访问,并使开发人员可以轻松地使用Spring Cloud编程模型来开发分布式应用程序服务。
Stars: ✭ 45 (-63.11%)
Mutual labels:  spring-cloud
java-microservice-experience
记录和总结在落地微服务的过程中的经验
Stars: ✭ 38 (-68.85%)
Mutual labels:  spring-cloud
spring-cloud-alibaba-component
Sample of Spring Cloud Alibaba component
Stars: ✭ 50 (-59.02%)
Mutual labels:  spring-cloud
spring-cloud-aws
All development has moved to https://github.com/awspring/spring-cloud-aws Integration for Amazon Web Services APIs with Spring
Stars: ✭ 587 (+381.15%)
Mutual labels:  spring-cloud
javayh-platform
javayh-platform 使用Springboot2.2.6为开发脚手架,SpringCloud为云端服务框架,Nacos为注册中心、分布式配置管理中心,Oauth2协议实现统一授权,Mybatis作为持久层框架,提供了代码生成器,SQL防注入,SwaggerAPI文档,Redis 作为缓存服务等强大的功能
Stars: ✭ 32 (-73.77%)
Mutual labels:  spring-cloud
sample-spring-cloud-gateway
sample spring cloud application with embedded api gateway on spring cloud gateway with or without service discovery with eureka
Stars: ✭ 25 (-79.51%)
Mutual labels:  spring-cloud
spring-cloud-docker-study
Spring Cloud 与 Docker 整合使用示例,为《使用Spring Cloud与Docker实战微服务》的配套代码。书籍地址:https://github.com/eacdy/spring-cloud-book 。讨论QQ群:157525002(已满)、564840207,欢迎加入。
Stars: ✭ 42 (-65.57%)
Mutual labels:  spring-cloud
Spring
Personal notes of preparation to Spring 5 Professional Certification
Stars: ✭ 35 (-71.31%)
Mutual labels:  spring-cloud
iam-service
IAM Service is used for the management of user, role, permission, organization, project, password policy, fast code, client, menu, icon, multi-language , and supports for importing third-party users through LDAP.
Stars: ✭ 39 (-68.03%)
Mutual labels:  spring-cloud
e-shop
Sample Spring Cloud microservices e-shop.
Stars: ✭ 48 (-60.66%)
Mutual labels:  spring-cloud
lua-resty-eureka-client
A Netflix Eureka client for OpenResty/ngx_lua
Stars: ✭ 18 (-85.25%)
Mutual labels:  spring-cloud
web-app
Angular 7 + Spring boot microservices + PostgreSQL
Stars: ✭ 26 (-78.69%)
Mutual labels:  spring-cloud
taotao-cloud-project
微服务开发脚手架,包括大数据模块、微服务模块、前端模块。基于Spring Cloud Alibaba的微服务架构。提供技术框架的基础能力的封装,减少开发工作,只关注业务,包含了工作以来的工作总结和技术沉淀
Stars: ✭ 76 (-37.7%)
Mutual labels:  spring-cloud
openshift-quickstart
Developer Workshops related to the Java development on OpenShift
Stars: ✭ 19 (-84.43%)
Mutual labels:  spring-cloud

mica-auto SPI、Spring boot starter 利器

Java CI JAVA 8 mica-auto Maven Codacy Badge

mica-autoSpring cloud 微服务框架 Mica 中的一个基础组件,用来生成 Spring boot starter 的一些基础配置。

简体中文 | English

版本更新记录

原理

mica auto 采用 Annotation Processor,她不是什么新技术,在 jdk 1.6 就存在了。 Annotation Processor 是 javac 的一个工具,它用来在编译时扫描和处理注解。通过 Annotation Processor 可以获取到注解和被注解对象的相关信息,然后根据注解自动生成Java代码,省去了手动编写,提高了编码效率。大名鼎鼎的 Lombok 也是采用的该技术。

使用场景

主要是用来避免 Spring boot 主项目包同 子项目或者子模块 包不一致,避免包扫描不到的问题。

  • 自定义 spring boot starter
  • 多模块项目中的子项目(不建议主项目添加 mica-auto)。

功能

  • 自动生成 spring.factories、spring-devtools.properties 配置(Spring boot starter 开发利器)。
  • 生成 FeignClient 到 spring.factories 中,供 mica-cloud 中完成 Feign 自动化配置。
  • 生成 java spi 配置,需要添加 @AutoService 注解。
注解 spring.factories 或 Spi key
@AutoContextInitializer ApplicationContextInitializer
@AutoListener ApplicationListener
@AutoRunListener SpringApplicationRunListener
@AutoEnvPostProcessor EnvironmentPostProcessor
@AutoFailureAnalyzer FailureAnalyzer
@AutoConfigImportFilter AutoConfigurationImportFilter
@AutoTemplateProvider TemplateAvailabilityProvider
@AutoEnableCircuitBreaker EnableCircuitBreaker
@AutoConfigDataLocationResolver ConfigDataLocationResolver
@AutoConfigDataLoader ConfigDataLoader
@AutoDatabaseInitializerDetector DatabaseInitializerDetector
@AutoDependsOnDatabaseInitializationDetector DependsOnDatabaseInitializationDetector
@Component EnableAutoConfiguration
@AutoIgnore 忽略,不生成到 spring.factories
@AutoService java Spi 生成配置

使用

注意: 如果你项目中使用了 Lombok 请将 mica-auto 的依赖放置到 Lombok 后面。

maven

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

gradle >= 5.x

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

gradle < 5.x

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

原理

扫描 @Component,自动生成相应的配置,支持组合注解。

mica 生态

开源协议

LGPL(GNU Lesser General Public License

LGPL是GPL的一个为主要为类库使用设计的开源协议。和GPL要求任何使用/修改/衍生之GPL类库的的软件必须采用GPL协议不同。LGPL允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。

但是如果修改LGPL协议的代码或者衍生,则所有修改的代码,涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议。因此LGPL协议的开源代码很适合作为第三方类库被商业软件引用,但不适合希望以LGPL协议代码为基础,通过修改和衍生的方式做二次开发的商业软件采用。

用户权益

  • 允许以引入不改源码的形式免费用于学习、毕设、公司项目、私活等。
  • 特殊情况修改代码,但仍然想闭源需经过作者同意。
  • 参考请注明:参考 mica-auto: https://github.com/lets-mica/mica-auto

参考

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

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

微信公众号

如梦技术

精彩内容每日推荐!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].