美文网首页
spring boot不用parent

spring boot不用parent

作者: xhrg | 来源:发表于2019-10-15 19:17 被阅读0次

在做spring boot项目的时候,我们经常会用到一个parent,pom配置文件如下

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

其实这个东西不是必须的,引用这个的作用仅仅是为了版本对其,所以即使你parent了他之后,如果要使用什么功能还是需要dependencies去引包。spring boot中除了boot本身的jar之外,还有很多spring的包版本,如果想要不引用parent,则可以引入以下

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

相关文章

网友评论

      本文标题:spring boot不用parent

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