在Maven中出现Could not find artifact ...:pom:0.0.1-SNAPSHOT and ‘parent.relativePath‘的错误怎么解决?

2年前 (2022) 程序员胖胖胖虎阿
133 0 0

在进行mvn-clean、mvn-install时,出现了"在Maven中出现Could not find artifact ...:pom:0.0.1-SNAPSHOT and 'parent.relativePath'"的问题,按照网上说“把父项目中的子项目先注掉,再进行mvn-clean”这种方法试了一下,还是不行,在子项目POM中发现了如下:

<parent>
    <groupId>com.example</groupId>
    <artifactId>springcloud</artifactId>
    <version>0.0.1</version>
    <relativePath/>(将此处注释)
</parent>

 于是将<relativePath/>注释掉,再重新mvn-clean、mvn-install,就不会出现以上的问题。就算是再重新加上<relativePath/>该注解,也是可以mvn-clean、mvn-install操作的。

相关文章

暂无评论

暂无评论...