1. 程式人生 > >Spring Boot 不依賴parent

Spring Boot 不依賴parent

當SpringBoot專案作為Maven子模組存在時,pom中不能存在兩個parent,這時有兩種解決方案:

1、在頂層專案的pom中依賴spring-boot-starter-parent;

2、在pom中使用如下依賴:

        <dependency>
            <!-- Import dependency management from Spring Boot -->
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.5.9.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
官方文件: