maven配置文件不對導致的錯誤

在進行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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章