pom文件中
1父项目
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent>
按住CTRL点进去那个spring-boot-starter-parent发现里面还依赖一个父项目叫
spring-boot-dependencies
再点进去这个dependencies往下拉发现下面的properties里面是依赖。他来管理所有的依赖称为spring boot的版本仲裁中心
以后导入依赖默认不需要写版本的因为所有的依赖都已经被dependencies管理
如果有没有被依赖的要写版本号。
2.导入的starter web 依赖,
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
spring bootstarter是场景启动器。
点进去发现里面有很多依赖帮我们导入了web正常运行所需要的依赖组件,
spring boot将所有的功能场景都抽取做成一个个starter,项目中引用starter就可以引入这些依赖,用什么功能导入什么场景启动器。