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

本文介绍了如何使用spring-boot-dependencies简化Maven项目的依赖管理,强调通常情况下无需自定义springframework版本,大多数依赖可从默认配置获取,只需针对个别过时jar进行自定义设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  <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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值