解决Maven ‘parent.relativePath‘ of POM问题

发布时间 2023-10-24 11:46:30作者: whatzyt

随笔内容来自:https://zhuanlan.zhihu.com/p/453547775

会出现这个问题的意思是,子模块的 parent 写的不是父模块;

一般这种情况出现在子模块继承了 springboot,父模块是自己创建的 pom 工程;

解决方案:

在该<parent>标签中加上<relativePath />

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

并且出现这种情况,还会伴随着子模块中的  <build> 标签中 spring-boot-maven-plugin 报红;