Non-resolvable parent POM Failure to find was cached in the local repository ‘parent.relativePath‘

简介: Non-resolvable parent POM Failure to find was cached in the local repository ‘parent.relativePath‘

问题:使用IDEA命令打包:mvn clean package时,报了如下错误:

Non-resolvable parent POM for ...: Failure to find .... in https

://repo.maven.apache.org/maven2 was cached in the local repository,

resolution will not be reattempted until the update interval of central has elapsed or upda

tes are forced and

'parent.relativePath' points at no local POM @ line 5, column 13 -> [Help 2]

分析:

第一时间去百度了这个问题,参考解决文章如下:

1.relativePath的问题

maven报错Non-resolvable parent POM---pom找不到parent_键盘林的博客-CSDN博客

2.maven仓库的问题

java——Project build error: Non-resolvable parent POM: Could not find artifact..._只怪星光太耀眼的博客-CSDN博客

于是按照这两个方向去修改,第一修改了relativePath为网上说的../../pom.xml,idea直接就报错了,或者把这个注释掉,打包也是报错的。第二,重新刷新了maven仓库,甚至把同事的maven库拷贝了过来,还是报一样的错。

再去看报错信息,在报错之前它去下载了一个pom:

[INFO] Scanning for projects...

Downloading from central: https://repo.maven.apache.org/maven2/com/aaa.pom

然后一看这个路径,根本就不对,所以猜测读取的文件路径不对。对于仓库地址,再回想之前是怎么配置的,之前是参考如下文章,在f盘配置了本地仓库与settings.xml。

Maven安装教程详解 - - ITeye博客

然后我的maven是安装在d盘下面的,依稀记得上面这篇文章中说maven安装目录下的settings.xml要和另外配置的f盘的相同。

所以我把f盘的settings.xml复制到了d盘安装目录下,再次重新执行命令,可以打包了。至此困扰几天的打包问题终于解决。

由此可见,打包的时候,可能读取的不是idea配置的那个f盘的settings.xml,可能还是读取的maven安装目录下的那个settings.xml。

所以下次安装时,不必另外存放settings.xml,在安装目录下新建本地仓库文件夹就行了。这样就只有一个settings.xml,不用两边去同步。

目录
相关文章
|
5月前
|
缓存 IDE Java
maven install报错原因揭秘:‘parent.relativePath‘指向错误的本地POM文件
在使用Maven构建项目时,遇到'parent.relativePath'错误通常是由于父项目POM路径设置错误、版本不一致或内容不匹配导致的。解决方法包括:校正父项目POM的相对路径、确保版本一致、保持POM文件内容同步,并排查其他潜在问题,如子模块命名冲突和Maven缓存问题。通过这些步骤可解决该错误,避免项目构建失败。
maven install报错原因揭秘:‘parent.relativePath‘指向错误的本地POM文件
|
2月前
|
Docker 容器
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
|
6月前
|
Oracle 关系型数据库
The opatch minimum version check for patch failed
The opatch minimum version check for patch failed
56 2
The project com.xx.xx has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact co
The project com.xx.xx has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact co
|
Java Maven
No valid Maven installation found. Either set the home directory in the configuration dialog or set
No valid Maven installation found. Either set the home directory in the configuration dialog or set
991 0
No valid Maven installation found. Either set the home directory in the configuration dialog or set
No package ‘libmate-menu‘ found
No package ‘libmate-menu‘ found
56 0
Package ffnvcodec was not found in the pkg-config search path
Package ffnvcodec was not found in the pkg-config search path
169 0
|
Docker 容器
no space left on device解决方法
no space left on device解决方法
|
Android开发
【转】svn:is not under version control and is not part of the commit, yet its child解决办法
来自:http://blog.csdn.net/lufeng20/article/details/7641093    在把写好的代码提交到svn上面时,遇到了一个错误如下: svn: Commit failed (details follow): svn: 'D:\eclipse\Statu...
1384 0
|
开发工具
Warning! This package referenced a Flutter repository via the .packages file that is no longer avail
Warning! This package referenced a Flutter repository via the .packages file that is no longer avail
125 0
Warning! This package referenced a Flutter repository via the .packages file that is no longer avail