问题
为什么在springboot工程的pom.xml中引入spring-boot-starter-parent和spring-boot-starterweb就可以表明是springboot项目,并可以直接使用spring、springmvc的注解以及配置呢?
答:
spring-boot-starter-parent:
最终使用dependencyManagement定义管理各种依赖包的版本
确定了可以引入springboot相关的依赖,将项目变成springboot项目
如图:
spring-boot-starter-web:
本身依赖了所有spring、springmvc相关的依赖包,通过依赖传递将依赖包依赖到项目中。
如图: