前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >学习SpringBoot系列 -01- 移除parent依赖

学习SpringBoot系列 -01- 移除parent依赖

作者头像
许杨淼淼
发布2019-12-29 20:07:52
1.7K0
发布2019-12-29 20:07:52
举报
文章被收录于专栏:醉程序醉程序醉程序

借着极客时间的付费课程《玩转Spring全家桶》的机会,系统性的对Spring家族做些学习和了解。

如题,常常项目中会要求统一一个 parent 依赖,而SpringBoot工程默认的 parent 是 spring-boot-starter-parent ,那么如何移除掉这个依赖以便使用其他的parent呢?官方已经考虑到这个问题了,很简单,可以这么做:

1. 在 pom.xml 配置文件中,增加下面这段依赖(当前版本号最新是2.1.3,请根据实际需要进行更改)

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

2. 在 pom.xml 配置文件中,更改 build 块的配置如下

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.3.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年2月23日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. 在 pom.xml 配置文件中,增加下面这段依赖(当前版本号最新是2.1.3,请根据实际需要进行更改)
  • 2. 在 pom.xml 配置文件中,更改 build 块的配置如下
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档