M2Eclipse:Maven Eclipse插件无法搜索远程库的解决方法
2016-03-11 12:06
573 查看
使用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 ,可以获得加快索引建立的方法。
ps:如果还是无法更新到 参见http://stackoverflow.com/questions/7065478/classic-error-unable-to-update-index-for-centralhttp-repo1-maven-org-maven2去处理试试
如果不能搜索远程库那用这个插件有啥用撒。。。
查遍了所有的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 ,可以获得加快索引建立的方法。
ps:如果还是无法更新到 参见http://stackoverflow.com/questions/7065478/classic-error-unable-to-update-index-for-centralhttp-repo1-maven-org-maven2去处理试试
相关文章推荐
- springMVC 的工作原理和机制
- java后台异步任务执行器TaskManager
- Spring mvc+Mybatis+DWZ代码生成器
- spring MVC
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- JAVA练习---人民币小写转大写
- Myeclipse优化
- Java的calendar类用法
- RxJava之subscribeOn解惑
- Java可变参数传递中可以接收多个对象
- spring(自动检测bean)
- JAVA设置当时时间大小
- Java中正则表达式匹配的语法规则
- java学习第一集:Hello World