美文网首页
Maven 项目使用开源中国镜像

Maven 项目使用开源中国镜像

作者: 帷幄庸者 | 来源:发表于2016-08-26 23:05 被阅读247次

从maven中央库下载jar非常缓慢甚至有时候会下载不下来。

可以采用中国的maven镜像。目前主要是 开源中国的镜像。

  1. 找到maven配置文件setting.xml,打开


  2. <mirrors> </mirrors> 中间添加开源中国的配置:

<!-- 开源中国 -->
<mirror>  
        <id>CN</id>  
        <name>OSChina Central</name>                                                                                                                         
        <url>http://maven.oschina.net/content/groups/public/</url>  
        <mirrorOf>central</mirrorOf>  
      </mirror> 
 <mirror>  
        <id>repo2</id>  
        <mirrorOf>central</mirrorOf>  
        <name>Human Readable Name for this Mirror.</name>  
        <url>http://repo2.maven.org/maven2/</url>  
      </mirror>  
  
 <mirror>
        <id>osc_thirdparty</id>
        <mirrorOf>thirdparty</mirrorOf>
        <url>http://maven.oschina.net/content/repositories/thirdparty/
        </url>
</mirror>
  
 <!-- 国外 -->
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>

<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror> 

修改完成后保存

  1. 重启eclipse,即可开源中国或者其他仓库去下载jar包

相关文章

网友评论

      本文标题:Maven 项目使用开源中国镜像

      本文链接:https://www.haomeiwen.com/subject/txizsttx.html