SpringBoot入门案例解析值starter
上一节我们讲到你的pom.xml中不写版本号是怎么跑起来的呢,是通过parent获取的版本号。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
下面看一下spring-boot-starter-web这里面有什么东西

可以看到spring-boot-starter-web里面又包含了一堆starter。



可以看到spring-boot-starter-web里面有一堆的依赖配置,也就是spring-boot-starter-web依赖于这里面的依赖配置,而pom.xml有依赖于spring-boot-starter-web,所以这就是传递依赖。
springboot之所以这么好用就是因为这个一堆的starter。
假如我想要a技术的starter直接引用a技术的starter即可,是很方便的,因为一个starter加入进来后,它里面还有很多的东西,其他是不用管的。



浙公网安备 33010602011771号