使用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 ,可以获得加快索引建立的方法。

GitHub 加速计划 / ma / maven
36
3
下载
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:2 个月前 )
e4327d3e Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.22 to 1.5.23. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.22...v_1.5.23) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-version: 1.5.23 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1 天前
5c98601f Bumps [org.apache.maven:maven-archiver](https://github.com/apache/maven-archiver) from 3.6.5 to 3.6.6. - [Release notes](https://github.com/apache/maven-archiver/releases) - [Commits](https://github.com/apache/maven-archiver/compare/maven-archiver-3.6.5...maven-archiver-3.6.6) --- updated-dependencies: - dependency-name: org.apache.maven:maven-archiver dependency-version: 3.6.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1 天前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐