springboot之核心依赖spring-boot-starter,spring-boot-starter-parent,spring-boot-starter-web依赖解析

参考:https://blog.csdn.net/zhou920786312/article/details/84324915

https://blog.csdn.net/tr1912/article/details/79217132

spring-boot-starter:spring-boot场景启动器,后面跟的单词就是场景,比如说后面跟web,就是导入web场景的所有依赖。

1. spring-boot-starter-parent(控制版本信息)

<parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>2.1.4.RELEASE</version>
   <relativePath/> 
</parent>

Spring Boot的版本仲裁中心,控制了所有依赖的版本号,

好处:以后我们导入依赖默认是不需要写版本;

2.spring-boot-starter

Spring Boot的核心启动器,包含了自动配置、日志和YAML

3. spring-boot-starter-web

web的场景,自动帮我们引入了web模块开发需要的相关jar包

4. spring-boot-starter-test

springboot程序测试依赖,如果是自动创建项目默认添加

一个正常springboot项目启动,依赖的基础包:

<dependencies>
   <!--springboot程序测试依赖,如果是自动创建项目默认添加-->
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
   </dependency>
   <!--springboot web模块支持,自动帮我们引入了web模块开发需要的相关jar包-->
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
   </dependency>
</dependencies>

猜你喜欢

转载自blog.csdn.net/qq_37164847/article/details/89508910