在进行mvn操作时报错信息,一直以为是版本不对问题,还对项目的各个pom依赖,以及父项目的进行了各种排查,其实都不后,最后终于发现问题原因
1、之前的mvn操作都是通过idea进行的clean和package等操作,并且idea上的maven配置是修改过的,指向的是E:\m2\settings.xml
2、今天是直接在命令行操作,这时候使用的是默认位置的settings.xml配置,在C盘上,由于不是同一个配置文件,报错了
3、最后把idea的使用的settings.xml文件,复制到命令行默认的路径,替换即可
下面是开始时,提示错误信息,提醒自己下次要记住了,否则又要浪费时间了
E:\project\test>mvn dependencies:tree
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.demo.test:test:1.0-SNAPSHOT: Failure to find com.demo.test:test:pom:2.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will no
t be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.demo.test:olap:1.0-SNAPSHOT (E:\project\test\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.demo.test:olap:1.0-SNAPSHOT: Failure to find com.demo.test:test:pom:2.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution wil
l not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
本文记录了一次在IDEA和命令行中使用不同Maven设置导致的问题及解决过程。问题表现为在进行mvn操作时遇到非可解析的父POM错误,原因是IDEA和命令行使用了不同的settings.xml配置文件。最终解决方案是将IDEA中使用的settings.xml文件复制并替换到命令行默认的路径中。
1210

被折叠的 条评论
为什么被折叠?



