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

目录
相关文章
|
6天前
|
XML 数据格式
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
10 0
|
6月前
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
Package ffnvcodec was not found in the pkg-config search path
Package ffnvcodec was not found in the pkg-config search path
130 0
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
813 0
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
【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
731 0
【SVN】is not known to exist in the repository and is not part of the commit, yet its child
|
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...
1326 0
how does local sandbox parse navigation target from hash
how does local sandbox parse navigation target from hash
103 0
how does local sandbox parse navigation target from hash
Access context of data source and work center view do not match
这个错误消息提示我们,data source的access context和待分配到工作中心的access context必须匹配:
Access context of data source and work center view do not match
|
API
Should we still build application buffer on top of CDS view
Should we still build application buffer on top of CDS view
85 0
Should we still build application buffer on top of CDS view