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

在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只有會有不同的子菜單:

我的如下圖:

 

 

然後點擊"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/p/5775087.html,如需轉載請自行聯繫原作者