Springboot 版本依赖管理

20 篇文章 1 订阅

Springboot[官方]如何进行依赖管理

涉及到Maven的parent的知识

在这里插入图片描述
在这里插入图片描述

主要是Spring自身还有第三方模块的依赖控制。

我们可以如何进行依赖管理

在这里插入图片描述

wheatdr-dependencies的pom里面增加
  • 模仿Spring专门建一个dependencies模块来管理
    引入Springboot的dependencies,也就是spring-boot-parent的父模块。
    注意scope、type设置,当然也可以在这里配置其他的springboot没有配置的依赖。
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.2.6.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
wheatdr-ear-learn的pom里面增加
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.wheatdr</groupId>
                <artifactId>wheatdr-dependencies</artifactId>
                <version>1.0.0-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
除了wheatdr-dependencies之外模块添加parent
    <parent>
        <artifactId>wheat-ear-learn</artifactId>
        <groupId>com.wheatdr</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值