maven镜像仓库

1.国内maven镜像仓库

阿里云镜像



aliyun
aliyun maven
http://maven.aliyun.com/nexus/content/groups/public/
central

开源中国镜像


OSChina
OSChina Central
http://maven.oschina.net/content/groups/public/
central

repo2 maven仓库


repo2
central
Human Readable Name for this Mirror.
http://repo2.maven.org/maven2/

net-cn 镜像


net-cn
central
Human Readable Name for this Mirror.
http://maven.net.cn/content/groups/public/

uk镜像


uk
central
Human Readable Name for this Mirror.
http://uk.maven.org/maven2/

ibiblio 镜像


ibiblio
central
Human Readable Name for this Mirror.
http://mirrors.ibiblio.org/pub/mirrors/maven2/

jboss镜像


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

2.添加maven仓库
2.1在POM中配置远程仓库



my-repo
my repository
http://localhost:8080/artifactory/my-repo/

true


true




my-repo
my repository
http://localhost:8080/artifactory/my-repo/

true


true



oss.sonatype.org
oss.sonatype.org
http://oss.sonatype.org/content/groups/public

2.2在settings.xml中配置远程仓库

除了在pox.xml配置仓库,setting文件可以作为一个全局的配置,但并不是简单的将POM中的元素复制到settings.xml中就可以,setting.xml不直接支持 这两个元素。但我们还是有一个并不复杂的解决方案,就是利用profile,如下:
[html] view plain copy 在CODE上查看代码片派生到我的代码片


...


dev




dev

...

这里我们定义一个id为dev的profile,将所有repositories以及pluginRepositories元素放到这个profile中,然后,使用元素自动激活该profile。这样,你就不用再为每个POM重复配置仓库。

posted on 2016-12-12 17:09  程序那些事  阅读(529)  评论(0)    收藏  举报
http://www.cnblogs.com/weiguo21/p/5191887.html