我是靠谱客的博主 昏睡小海豚,这篇文章主要介绍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>


修改完成后保存。

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

最后

以上就是昏睡小海豚最近收集整理的关于Maven项目使用开源中国镜像的全部内容,更多相关Maven项目使用开源中国镜像内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(52)

评论列表共有 0 条评论

立即
投稿
返回
顶部