M2Eclipse:Maven Eclipse插件无法搜索远程库的解决方法
http://blog.csdn.net/shootyou/article/details/5262560
使用Eclipse安裝了maven插件之后,創建Maven工程,發現添加依賴“Add Dependency”的時候無法自動搜索遠程庫。
?
如果不能搜索遠程庫那用這個插件有啥用撒。。。
?
查遍了所有的maven配置文件都沒發現問題。
?
最后發現是插件本身的問題。原因是遠程庫的索引沒有成功的建立。
?
很有可能安裝插件之后的某一次“Update Indexes”失敗之后,導致默認的index“http://repo1.maven.org/maven2/”無法繼續更新。所以每次都會報錯: Unable to update?index?for central?http?://repo1?.maven?.org?/maven2?/ 。
?
也就說一次更新失敗導致了以后的Update index都失敗了。
?
這個時候執行以下操作:
?
http://readthefuckingmanual.net/error/2394/
?
Do in eclipse: window->show view->other->maven->maven indexes. One of the indexes is:?
http://repo1.maven.org/maven2.?
right-click on this one, and try rebuild index.?
If that does not work, create a new index with the same address, and do a rebuild of that. With me that worked, and I could remove the original one. After this a restart of eclipse will NOT show the error anymore, and the add dependency search function operates as it should. Problem solved.
?
另外,參考 http://forum.springside.org.cn/redirect.php?tid=2876&goto=lastpost ,可以獲得加快索引建立的方法。
http://kyfxbl.iteye.com/blog/1684966
http://www.oschina.net/news/44282/oschina-maven-repository
http://maven.oschina.net/help.html
總結
以上是生活随笔為你收集整理的M2Eclipse:Maven Eclipse插件无法搜索远程库的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Web安全测试之XSS
- 下一篇: jQuery Mobile 教程