在开发过程中,SpringBoot项目会导入一个父类的dependency,这个依赖是需要去指定一个统一版本的,而这个版本根据实际开发而变更
org.springframework.boot spring-boot-starter-parent<11./artifactId>2.2.2.RELEASE
从这用鼠标左键+ctrl点入,发现在parent的底层还有一个依赖:Spring-boot-dependencies
org.springframework.boot spring-boot-dependencies2.2.2.RELEASE ../../spring-boot-dependencies
同样的方法继续点入进去,发现会对一些常用的依赖文件进行了版本号的限定,比如mysql,activemq,solr,tomcat.....。而这些则与最上层的SpringBoot2.2的版本像绑定,减少了在搭建环境时因为依赖版本冲突不匹配等问题导致运行失败。
二,SpringBoot启动项目运行的jar包依赖5.15.11 ... 8.2.0 8.0.18 2.3.1 2.2.2.RELEASE 2.0.4.RELEASE 1.2.4.RELEASE 5.2.1.RELEASE Corn-RELEASE 3.0.8.RELEASE 3.28.0 ${jakarta-mail.version} 9.0.29 3.0.11.RELEASE 2.0.1 ...
这了简单举个例子,在SpringBoot用到了Spring表现层的Controller,那么势必引用了SpringMVC相关的依赖,那么这是在哪儿引用进来的?使用MVC,SpringBoot需要去引入spring-boot-starter-web依赖,这个依赖点进去。
以下为spring-boot-starter-webׁ引入依赖部分
org.springframework.boot spring-boot-starter2.2.2.RELEASE compile org.springframework.boot spring-boot-starter-json2.2.2.RELEASE compile org.springframework.boot spring-boot-starter-tomcat2.2.2.RELEASE compile org.springframework.boot spring-boot-starter-validation2.2.2.RELEASE compile tomcat-embed-el org.apache.tomcat.embed org.springframework spring-web5.2.2.RELEASE compile org.springframework spring-webmvc5.2.2.RELEASE compile
而且不仅仅是web-started,SpringBoot的官方文档中同样提供了其它场景下开发的启动器



