Spring Boot 依赖管理特性

来自姬鸿昌的知识库
跳到导航 跳到搜索

https://www.bilibili.com/video/BV19K4y1L7MT/?p=6

父项目做依赖管理

boot-01-helloworld - pom.xml

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


spring-boot-starter-parent-2.3.4.RELEASE.pom

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>2.3.4.RELEASE</version>
  </parent>
  <artifactId>spring-boot-starter-parent</artifactId>
  <packaging>pom</packaging>
  <name>spring-boot-starter-parent</name>


spring-boot-dependencies-2.3.4.RELEASE.pom

  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-dependencies</artifactId>
  <version>2.3.4.RELEASE</version>
  <packaging>pom</packaging>
  <properties>
    <activemq.version>5.15.13</activemq.version>
    <antlr2.version>2.7.7</antlr2.version>
    <appengine-sdk.version>1.9.82</appengine-sdk.version>
    <artemis.version>2.12.0</artemis.version>
  ……
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-amqp</artifactId>
        <version>${activemq.version}</version>
      </dependency>
      ……
    </dependencies>
  </dependencyManagement>

几乎声明了所有开发中常用依赖的版本号,自动版本仲裁机制