我剛剛將一個Maven多模塊項目部署到了Nexus的SNAPSHOT版本。Maven無法解析SNAPSHOT依賴關係
已部署的工件存在於Nexus快照存儲庫中,我可以直接通過Nexus界面下載它們。
但是,當我將這些工件作爲依賴項添加到另一個項目時,Maven無法解決它們。
我得到以下錯誤:
Downloading: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/maven-metadata.xml
Downloaded: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/maven-metadata.xml (835 B at 15.1 KB/sec)
Downloading: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/<artifactId>-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.056s
[INFO] Finished at: Tue Mar 25 17:49:23 IST 2014
[INFO] Final Memory: 11M/234M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-project: Co
uld not resolve dependencies for project com.example:my-project:jar:2.0-SNAPSHOT: Could not find artifact <groupId>:<artifactId>:jar:1.0-SNAPSHOT in nexus (http://<nexus-url>/nexus/content/groups/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
注意的Maven不會嘗試下載該文件maven-metadata.xml
。
謝謝,邁克爾 -
編輯: Maven的DOES下載文件maven-metadata.xml
。使用-U
沒有幫助。
看來,Maven試圖下載工件,而無需將SNAPSHOT轉換爲適當的時間戳。
你的錯誤信息被嚴重截斷了,我相信。 – chad
@chad謝謝,我編輯過。 –
它看起來沒有工件的名稱和組ID。 。 。它正在尋找::jar:1.0-SNAPSHOT你的pom在依賴聲明中必須有一個錯誤。 –
chad