Spring Boot初始(三)

解析pom.xml

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
    </parent>
    Ctrl长按点开父项目

在这里插入图片描述

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>2.2.1.RELEASE</version>
    <relativePath>../../spring-boot-dependencies</relativePath>
  </parent>
  它的父项目是spring-boot-dependencies,点开发现

spring-boot-dependencies真正管理应用里面的版本依赖
是版本仲裁中心,自动配置好,因此我们不需要再写版本信息(当然没有在dependencies中管理的我们需要再声明)
在这里插入图片描述

导入的依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        长按Ctrl点进去查看

在这里插入图片描述
有关hibernate、SpringMVC、ajax、jdbc等的依赖,版本号都囊括在内,帮我们导入了web模块相关的依赖,依赖的版本都受父项目版本仲裁
Spring Boot将所有的功能场景抽离出来做成了starters(启动器),只需要在项目中引入这些starters的相关依赖,要用什么功能,就导入什么场景启动器

发布了73 篇原创文章 · 获赞 20 · 访问量 4459

猜你喜欢

转载自blog.csdn.net/lzl980111/article/details/103715368