首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

eclipse中运用maven插件 index不能更新

2012-09-01 
eclipse中使用maven插件 index不能更新问题产生如下:因为单位使用了过滤,访问Internet时,超过10M的内容就

eclipse中使用maven插件 index不能更新

问题产生如下:
因为单位使用了过滤,访问Internet时,超过10M的内容就拒绝。
因为maven插件在初始时,需要下载Maven的index文件,这个文件比较大,有38M多,下载不成功。
所以造成使用Maven添加依赖项时(Add Dependency)时,没有提示项目可用,并且在Console中,输出:
Unable to update index for central|http://repo1.maven.org/maven2 。解决方式如下:1、通过其它方式下载如下两个文件:
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
http://repo2.maven.org.s3.amazonaws.com/.index/nexus-maven-repository-index.gz2、找一个Apache服务器,在其根据目录下建立一个 .index 的目录,把上述两个文件拷贝至该目录下。3、编辑 c:\WINDOWS\system32\drivers\etc\hosts 文件,在文件中加入:
10.15.2.52??? repo2.maven.org.s3.amazonaws.com
注:10.15.2.52 为步骤2的Apache服务器IP地址。4、在Eclipse中,打开 Maven Repositories 面板,
在 Global Repositories --> central 项上,点右键,Rebuild Index 即可。5、移除之前在 hosts 文件中添加的内容。6、(可选)把Properties中Maven项的 Download repository index updates on starup 选项去除。

热点排行