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,不用两边去同步。

目录
相关文章
|
4月前
|
Java
No tag [else] defined in tag library imported with prefix [c]] with root cause
No tag [else] defined in tag library imported with prefix [c]] with root cause 错误处理
38 0
|
4月前
|
Java 应用服务中间件
Tomcat 报错:The origin server did not find a current representation for the target resource
Tomcat 报错:The origin server did not find a current representation for the target resource
55 1
|
10月前
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
837 0
No valid Maven installation found. Either set the home directory in the configuration dialog or set
No plugin found for prefix ‘doclint‘ in the current project
No plugin found for prefix ‘doclint‘ in the current project
117 0
Package ffnvcodec was not found in the pkg-config search path
Package ffnvcodec was not found in the pkg-config search path
158 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
118 0
Warning! This package referenced a Flutter repository via the .packages file that is no longer avail
|
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...
1365 0
【SVN】is not known to exist in the repository and is not part of the commit, yet its child
【SVN】is not known to exist in the repository and is not part of the commit, yet its child
869 0
【SVN】is not known to exist in the repository and is not part of the commit, yet its child