使用spring-boot-dependencies简化依赖管理

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.3.0.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

点击去上面的依赖spring-boot-dependencies,看到已经依赖了:

<dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>5.2.6.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

除非想自定义springframework的依赖版本,否则不需要再使用spring-framework-bom

其实大部分依赖可以从spring-boot-dependencies找到,剩余的自定义即可。


对于platform-bom依赖管理没必要,有些jar版本太久了:

<dependency>
                <groupId>io.spring.platform</groupId>
                <artifactId>platform-bom</artifactId>
                <version>Cairo-SR8</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
经验分享 程序员 微信小程序 职场和发展