spring-boot-starter-parent的作用详解
我们SpringBoot项目pom文件中都会引入spring-boot-starter-parent这样一个依赖,如下:
那spring-boot-starter-parent的作用是什么呢?
其实从字面意思上看是spring-boot-starter的一个parent,那就是引入和定义starter相关的东西。
具体来看可以分为以下两点:
一、统一定义配置:
spring-boot-starter-parent代码如下,定义编码、java版本等:
二、统一依赖及版本:
spring-boot-starter-parent代码如下:
spring-boot-dependencies代码如下:
中定义了非常多指定版本的依赖,比如上述的redis、quartz等,这样在具体开发的模块中只需按以下方式引入依赖即可,不必指定版本:
为什么不必指定版本,参考
到此这篇关于spring-boot-starter-parent的作用详解的文章就介绍到这了,更多相关spring-boot-starter-parent内容请搜索编程学习网以前的文章希望大家以后多多支持编程学习网!