美文网首页
springboot不使用继承,使用依赖

springboot不使用继承,使用依赖

作者: 放开好人 | 来源:发表于2021-01-30 14:51 被阅读0次

把里面的继承

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

替换为

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

为什么要把继承替换为依赖呢?主要是因为实际项目往往都定义了自己的父工程的,不能再继承springboot了

相关文章

网友评论

      本文标题:springboot不使用继承,使用依赖

      本文链接:https://www.haomeiwen.com/subject/xbxktltx.html