引言
我们日常项目中都会用到springboot,只要我们用到springboot,一定会用到各种spring-boot-starter。下面我们通过一个springboot starter 的demo(实现一个简单的通过日志记录方法的执行时间的一个组件)制作过程来总结如何定制自己的springboot starter 组件。
一、创建一个Maven工程在使用spring-boot-starter,会发现,有的项目名称是 XX-spring-boot-starter,有的是spring-boot-starter-XX,这个项目的名称有什么讲究呢?从springboot官方文档摘录如下:
Do not start your module names with spring-boot, even if you use a different Maven groupId. We may offer official support for the thing you auto-configure in the future.
As a rule of thumb, you should name a combined module after the starter.
从这段话可以看出spring-boot-starter命名的潜规则:spring-boot-starter-XX是springboot官方的starter,XX-spring-boot-starter是第三方扩展的starter。
关注
打赏
热门博文
- Java基础学习总结(175)——分布式ID的9种生成方式总结
- 2016年终总结
- 青春路上,岁月如烟
- Terraform 学习总结(10)—— 阿里云平台 Terraform 代码开发技巧总结
- Terraform 学习总结(9)—— 如何解决存量云资源的管理难题
- Java基础学习总结(197)—— CompletableFuture 异常处理总结
- Kubernetes 学习总结(36)—— Kubernetes 本地运行的四种方法
- Linux 学习总结(90)—— Linux 远程数据同步工具 Rsync(remote synchronize)详解
- Java基础学习总结(196)—— Java、Spring、Dubbo 三种 SPI 机制详解
- Kubernetes 学习总结(35)—— Kubernetes 1.25 正式发布,多方面重大突破