解决maven Unable to update index for central|http://repo1.maven.org/maven2 的问题
2015-02-03 14:58
465 查看
新配置了一个maven的环境,远程仓库默认为maven官网的,然后发现在myeclipse里用maven搜索jar包时,一个都搜不到,于是开始找原因,试了各种办法,还是不行。
后来查了一下maven需要在update index之后才能帮助我们自动搜索jar包。
解决办法,手动update index:
1、首先手动去官网下载这两个文件,
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz 2、然后把这两个文件放到本地tomcat的目录中去,我是放在webapps\ROOT\maven2\.index\目录中(这里说明一下,前面带点的文件夹不能用右键新建,要打开cmd窗口,用命令mkdir .index创建)
3、接着增加一个mirror,地址写刚刚tomcat的地址就好了(也可以更改域名的指向,将repo1.maven.org指向127.0.0.1)
<mirror>
<id>nexus-local</id>
<mirrorOf>central</mirrorOf>
<name>nexus local</name>
<url>http://localhost/maven2/.index</url>
</mirror>
4、然后打开myeclipse,点开preferences—Maven4MyEclipse—Maven—User Settings,点击Update Settings,等待几分钟,就可以更新完毕。
5、更新完毕后,再搜索jar包,就OK了。
后来查了一下maven需要在update index之后才能帮助我们自动搜索jar包。
解决办法,手动update index:
1、首先手动去官网下载这两个文件,
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz 2、然后把这两个文件放到本地tomcat的目录中去,我是放在webapps\ROOT\maven2\.index\目录中(这里说明一下,前面带点的文件夹不能用右键新建,要打开cmd窗口,用命令mkdir .index创建)
3、接着增加一个mirror,地址写刚刚tomcat的地址就好了(也可以更改域名的指向,将repo1.maven.org指向127.0.0.1)
<mirror>
<id>nexus-local</id>
<mirrorOf>central</mirrorOf>
<name>nexus local</name>
<url>http://localhost/maven2/.index</url>
</mirror>
4、然后打开myeclipse,点开preferences—Maven4MyEclipse—Maven—User Settings,点击Update Settings,等待几分钟,就可以更新完毕。
5、更新完毕后,再搜索jar包,就OK了。
相关文章推荐
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- MyEclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决MyEclipse的Unable to update index for central|http://repo1.maven.org/maven2问题
- Unable to update index for central http://repo1.maven.org/maven2/ 解决方法
- Unable to update index for central http://repo1.maven.org/maven2/ 解决方法
- Unable to update index for central http://repo1.maven.org/maven2/ 效率问题
- Unable to update index for central http://repo1.maven.org/maven2/ 解决方法
- Unable to update index for central http://repo1.maven.org/maven2/
- Unable to update index for central http://repo1.maven.org/maven2/
- Unable to update index for central http://repo1.maven.org/maven2/
- Unable to update index for central http://repo1.maven.org/maven2/
- Myeclipse启动时 Unable to update index for central http://repo1.maven.org/maven2/错误
- Unable to update index for central|http://repo1.maven.org/maven2
- Unable to update index for central http://repo1.maven.org/maven2/
- JAVA MyEclipse(3)---解决MyEclipse安装maven的问题:Unable to update index for central
- 异常信息:Unable to update index for aliyun|http://maven.aliyun.com/nexus/content/groups/public/ 解决方法