微服务框架代码自动生成 mica-auto

码农软件 · 软件分类 · 微服务框架 · 2019-03-17 15:42:24

软件介绍

mica-auto 代码自动生成

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

功能

  1. 生成 spring.factories

  2. 生成 spring-devtools.properties

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

使用

maven

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

gradle >= 5.x

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

gradle < 5.x

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

原理

扫描 @Configuration,自动生成相应的配置。

注意: v1.0.0 已经支持组合注解。

初衷

在编写 Spring boot 相关插件的时候经常需要编写和修改 spring.factories 文件,其中有一次忘记修改,导致服务启动报错。想到编译期间自动生成这种配置。

开源协议

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

本文地址:https://codercto.com/soft/d/1554.html

Reality Is Broken

Reality Is Broken

Jane McGonigal / Penguin Press HC, The / 2011-1-20 / USD 26.95

Visionary game designer Jane McGonigal reveals how we can harness the power of games to solve real-world problems and boost global happiness. More than 174 million Americans are gamers, and......一起来看看 《Reality Is Broken》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具