3 回答

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊
您可以像使用“ bom”一樣使用spring-boot-starter-parent(請(qǐng)參閱Spring和Jersey現(xiàn)在支持該功能的其他項(xiàng)目),并將其僅包含在scope = import的依賴項(xiàng)管理部分中。這樣您將獲得很多收益使用它的好處(即依賴項(xiàng)管理),而無需替換實(shí)際父項(xiàng)中的設(shè)置。
它做的其他2件事是
定義屬性負(fù)載以快速設(shè)置要覆蓋的依賴項(xiàng)版本
使用默認(rèn)配置(主要是Spring Boot maven插件)配置一些插件。因此,如果您使用自己的父母,那么您將必須手動(dòng)執(zhí)行這些操作。
Spring Boot文檔中提供的示例:
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<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>

TA貢獻(xiàn)1898條經(jīng)驗(yàn) 獲得超8個(gè)贊
根據(jù)Surasin Tancharoen的回答,您可能還需要定義maven surefire插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
并可能包括故障快速插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
分享編輯
- 3 回答
- 0 關(guān)注
- 796 瀏覽
添加回答
舉報(bào)