Maven Eclipse插件無法搜索遠(yuǎn)程庫的解決方法
使用Eclipse安裝了maven插件之后,創(chuàng)建Maven工程,發(fā)現(xiàn)添加依賴“Add Dependency”的時候無法自動搜索遠(yuǎn)程庫。
如果不能搜索遠(yuǎn)程庫那用這個插件有啥用撒。。。
查遍了所有的maven配置文件都沒發(fā)現(xiàn)問題。
最后發(fā)現(xiàn)是插件本身的問題。原因是遠(yuǎn)程庫的索引沒有成功的建立。
很有可能安裝插件之后的某一次“Update Indexes”失敗之后,導(dǎo)致默認(rèn)的index“http://repo1.maven.org/maven2/”無法繼續(xù)更新。所以每次都會報(bào)錯: Unable to update index for central http ://repo1 .maven .org /maven2 / 。
也就說一次更新失敗導(dǎo)致了以后的Update index都失敗了。
這個時候執(zhí)行以下操作:
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,可以獲得加快索引建立的方法。
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。