Maven 项目使用开源中国镜像


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

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

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

  2. 中间添加开源中国的配置:

<!-- 开源中国 -->
<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> 

修改完成后保存
3. 重启eclipse,即可开源中国或者其他仓库去下载jar包


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM