天天看點

Eclipse中導入項目pom.xml報錯Maven錯誤Failed to read artifact descriptor for xxx:jar 和 missing artifact maven dependency

Maven錯誤Failed to read artifact descriptor for xxx:jar 和 missing artifact maven dependency

可參考:http://stackoverflow.com/questions/6111408/maven2-missing-artifact-but-jars-are-in-place

http://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor

在MyEclipse中執行Maven的install指令時或者Maven項目中的pom.xml增加新的依賴時,報“Failed to read artifact descriptor for xxx:jar ”或者"missing artifact maven dependency"的錯誤。這可能是在下載下傳過程中檔案出現錯誤。

解決辦法:從本地的maven庫中删除相關的jar包,然後右單擊項目,Maven4MyEclipse->Update Project,在彈出的對話框中選擇“Force Update Of Snapshots/Releases"

然後點選“OK”。這樣就會重新下載下傳這個jar包。

不同的Eclipse版本項目右鍵Maven隻有會有不同的子菜單:

我的如下圖:

Eclipse中導入項目pom.xml報錯Maven錯誤Failed to read artifact descriptor for xxx:jar 和 missing artifact maven dependency
Eclipse中導入項目pom.xml報錯Maven錯誤Failed to read artifact descriptor for xxx:jar 和 missing artifact maven dependency

然後點選"OK" 就可以了........

//=================================================

此外還有提供的另外幾種方式....(個人嘗試沒有效果)

There are a few other options apart from Project->Clean, some of which are more along the lines of turning it off and on again.

  • Try right-clicking on the project and selecting Maven->Update Project Configuration.
  • Disable then re-enable dependency management (right-click Maven->Disable Dependency Management then Maven->Enable Dependency Management
  • Close the project and reopen it.
  • Check that your Maven settings are configured correctly. If you are behind a proxy you'll need toconfigure the proxy settings in the global or user settings.
  • Check you're using the Maven installation you expect. By default m2eclipse uses the embedder, if you have a separate installation you may want to configure m2eclipse to use the external installation so that CLI and Eclipse builds are consistent. This also ensures you're configured to connect through any proxy as above.

作者:SummerChill 

出處:http://www.cnblogs.com/DreamDrive/ 

本部落格為自己總結亦或在網上發現的技術博文的轉載。 如果文中有什麼錯誤,歡迎指出。以免更多的人被誤導。