解决Maven子项目提示 ‘parent.relativePath‘ of POM

错误内容

Some problems were encountered while building the effective model for org.springframework.boot:test01:jar:2.4.0
'parent.relativePath' of POM org.springframework.boot:test01:2.4.0 (E:\JavaWeb_base\springbootTest\test01\pom.xml) points at com.ltb:springbootTest instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure @ line 7, column 13
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.

错误分析
子模块的parent写的不是父模块,而是继承了springboot

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

解决方法
在该标签中加上

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>2.4.0</version>
  <relativePath   />
</parent>
posted @ 2021-12-07 10:04  崔安兵  阅读(6365)  评论(0编辑  收藏  举报