2014-03-03 91 views
4

我收到以下錯誤在我的pom.xml的Maven pom.xml的錯誤在Eclipse

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://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 updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org 
+0

你試過強制更新嗎?看看[這個問題](http://stackoverflow.com/questions/4856307/when-maven-says-resolution-will-not-be-reattempted-until-the-update-interval-of)。 – eebbesen

+0

嗨,是的,我試圖更新它,但現在我怎麼能修復它。? –

+0

我發現在這種情況下強制更新適用於我,只要工件Maven正在尋找它存在於它正在尋找的位置。對於我來說,當信息顯示「在中央的更新時間間隔已過或強制更新之前,不會重新嘗試解析」,這是當我強制更新以刪除該消息時。正如鏈接問題所述,您可以使用Eclipse中的設置來強制更新,或者可以使用命令行中的「-U」標誌來強制更新。 – eebbesen

回答

8
  1. 轉到目錄{Home}/.m2/repository/org/apache的第一道防線。
  2. 刪除maven文件夾。
  3. 右鍵點擊Eclipse中的Maven項目,然後選擇Maven的 - >更新項目...
  4. 在出現的對話框中,選擇Force Update of Snapshots/Releases並單擊OK

確保,你沒有任何再次更新項目時與代理相關的問題。

+0

非常感謝。它真的有訣竅。我浪費了幾個小時試圖弄清楚爲什麼eclipse只是說我的pom.xml中有一個錯誤,其描述爲「unknown」 – Jocken