您当前的位置: 首页 >  ar

科技D人生

暂无认证

  • 0浏览

    0关注

    1550博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Spring Boot学习总结(22)——如何定制自己的 springboot starter 组件呢?

科技D人生 发布时间:2020-08-11 16:58:28 ,浏览量:0

引言

我们日常项目中都会用到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。

            
关注
打赏
1662604032
查看更多评论
0.1691s