maven中常遇到的一些錯誤,maven中常遇到錯誤
1,eclipse could not resolve archetype這個是在eclipse建立項目時,選擇archetype時出現的:
在建立maven工程時報錯:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact
Missing org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE
could not resolve archetype這個錯誤出現的原因是,在建立項目時使用的是我自己配置的maven倉庫中心,但是未啟動nexus伺服器,這時就會在maven中找不到。但是重新啟動nexus時,它不會再重新嘗試擷取了。這個在錯誤的詳細資料中會有提示。
could not resolve archetype解決辦法是刪除maven倉庫下載的jar,即在maven的settings.xml配置的下載路徑,並且更換一個workplace,然後重新設定一下maven,
重新匯入項目就可以了。
2,was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
這個錯誤一般是在第一次更新jar的時候沒有啟動中心倉庫nexus,但是重新啟動後,它又不更新了。目前我的解決方案的是進入到nexus的目錄下D:\Soft\windows\nexus-2.14.0-01-bundle\sonatype-work\nexus\storage\central,找到你更新失敗的那個jar包的目錄。重新在eclipse中 install 一下就可以了。這是maven中經常遇到的錯誤之一