maven镜像仓库

1.国内maven镜像仓库

阿里云镜像

  1. <mirrors>
  2. <mirror>
  3. <id>aliyun</id>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public/</ur>
  6. <mirrorOf>central</mirrorOf>
  7. </mirror>
  8. </mirrors>

开源中国镜像

  1. <mirror>
  2. <id>OSChina</id>
  3. <name>OSChina Central</name>
  4. <url>http://maven.oschina.net/content/groups/public/</url>
  5. <mirrorOf>central</mirrorOf>
  6. </mirror>

repo2 maven仓库

  1. <mirror>
  2. <id>repo2</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>Human Readable Name for this Mirror.</name>
  5. <url>http://repo2.maven.org/maven2/</url>
  6. </mirror>

net-cn 镜像

  1. <mirror>
  2. <id>net-cn</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>Human Readable Name for this Mirror.</name>
  5. <url>http://maven.net.cn/content/groups/public/</url>
  6. </mirror>

uk镜像

  1. <mirror>
  2. <id>uk</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>Human Readable Name for this Mirror.</name>
  5. <url>http://uk.maven.org/maven2/</url>
  6. </mirror>

ibiblio 镜像

  1. <mirror>
  2. <id>ibiblio</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>Human Readable Name for this Mirror.</name>
  5. <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
  6. </mirror>

jboss镜像

  1. <mirror>
  2. <id>jboss-public-repository-group</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>JBoss Public Repository Group</name>
  5. <url>http://repository.jboss.org/nexus/content/groups/public/url>
  6. </mirror>
2.添加maven仓库
2.1在POM中配置远程仓库
  1. <repositories>
  2. <repository>
  3. <id>my-repo</id>
  4. <name>my repository</name>
  5. <url>http://localhost:8080/artifactory/my-repo/</url>
  6. <releases>
  7. <enabled>true</enabled>
  8. </releases>
  9. <snapshots>
  10. <enabled>true</enabled>
  11. </snapshots>
  12. </repository>
  13. </repositories>
  14. <pluginRepositories>
  15. <pluginRepository>
  16. <id>my-repo</id>
  17. <name>my repository</name>
  18. <url>http://localhost:8080/artifactory/my-repo/</url>
  19. <releases>
  20. <enabled>true</enabled>
  21. </releases>
  22. <snapshots>
  23. <enabled>true</enabled>
  24. </snapshots>
  25. </pluginRepository>
  26. <pluginRepository>
  27. <name>oss.sonatype.org</name>
  28. <id>oss.sonatype.org</id>
  29. <url>http://oss.sonatype.org/content/groups/public</url>
  30. </pluginRepository>
  31. </pluginRepositories>
2.2在settings.xml中配置远程仓库

除了在pox.xml配置仓库,setting文件可以作为一个全局的配置,但并不是简单的将POM中的及元素复制到settings.xml中就可以,setting.xml不直接支持 这两个元素。但我们还是有一个并不复杂的解决方案,就是利用profile,如下:

[html] view plain copy 在CODE上查看代码片派生到我的代码片

  1. <settings>
  2. ...
  3. <profiles>
  4. <profile>
  5. <id>dev</id>
  6. <!-- repositories and pluginRepositories here-->
  7. </profile>
  8. </profiles>
  9. <activeProfiles>
  10. <activeProfile>dev</activeProfile>
  11. </activeProfiles>
  12. ...
  13. </settings>

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

maven仓库使用的更多相关文章

  1. 转:aliyun阿里云Maven仓库地址——加速你的maven构建

    maven仓库用过的人都知道,国内有多么的悲催.还好有比较好用的镜像可以使用,尽快记录下来.速度提升100倍. http://maven.aliyun.com/nexus/#view-reposito ...

  2. aliyun阿里云Maven仓库地址——加速你的maven构建

    maven仓库用过的人都知道,国内有多么的悲催.还好有比较好用的镜像可以使用,尽快记录下来.速度提升100倍. http://maven.aliyun.com/nexus/#view-reposito ...

  3. maven仓库信息分析站点推荐

    maven是java的一个依赖,打包管理的工具,稍微大一点的java项目都需要使用maven. 随着java的壮大,maven仓库越来越大,仓库中的jar包有60多万,各种group,各种构件,各种版 ...

  4. 国内好用的maven仓库,添加到本地nexus中

    速度快的maven仓库真的难找,国外网站很多被封了.前天在网上找,有人说阿里有个公开的,速度很快.确实很快! 我添加到本地nexus中,结果不能更新索引,我是这么添加的,如下: 这个地址在浏览器中能够 ...

  5. Maven最佳实践:Maven仓库(转)

    转自:http://juvenshun.iteye.com/blog/359256 什么是Maven仓库 在不用Maven的时候,比如说以前我们用Ant构建项目,在项目目录下,往往会看到一个名为/li ...

  6. maven 仓库地址:

    maven 仓库地址: 共有的仓库 http://repo1.maven.org/maven2/http://repository.jboss.com/maven2/ http://repositor ...

  7. 配置maven仓库

    1.安装完,配置好环境变量 mvn -v 检查是否成功 mvn install 会将项目生成的构件安装到本地maven仓库 2.settings.xml文件配置: 1)修改本地仓库位置 maven_h ...

  8. 收集的maven 仓库地址(maven repository)

    maven 仓库地址: 共有的仓库http://repo1.maven.org/maven2/http://repository.jboss.com/maven2/http://repository. ...

  9. maven仓库介绍《本地仓库、远程仓库》

    在Maven中,任何一个依赖.插件或者项目构建的输出,都可以称之为构件.Maven在某个统一的位置存储所有项目的共享的构件,这个统一的位置,我们就称之为仓库.(仓库就是存放依赖和插件的地方)任何的构件 ...

随机推荐

  1. Thinkphp源码分析系列(三)– App应用程序类

    // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO ...

  2. iOS富文本

    背景:前些天突然想做一个笔记本功能,一开始,觉得挺简单的呀,一个UITextView,网络缓存也不干了,直接本地NSUserDefault存储,然后完事了,美工,弄几张好看的图片,加几个动画,也就这样 ...

  3. js中的三元运算符

    <script type="text/javascript"> var b=5; (b == 5) ? a="true" : a="fal ...

  4. 2o_TwoTips

    ∮Linux 使用的两个小技巧 开启启动脚本 和 环境变量问题 §1.开机启动脚本 && 周期任务 环境 CentOS7:3.10.0-327.el7.x86_64 # head /e ...

  5. Jquery.cookie.js 源码和使用方法

    jquery.cookie.js源码和使用方法 jQuery操作cookie的插件,大概的使用方法如下 $.cookie(‘the_cookie’); //读取Cookie值$.cookie(’the ...

  6. 44、NLP的其他分词功能测试

    1. 命名实体识别功能测试 @Test public void testNer(){ if (NER.create("ltp_data/ner.model")<0) { Sy ...

  7. C语言的文法分析

    <程序>  ->   <声明> | <程序> <函数> <声明>  ->   #include<stdio.h>|# ...

  8. Redis从基础命令到实战之列表类型(List)

    经过上一篇基于Redis散列类型的改造后,实战练习中的商品管理已经具备了增加.修改整体.修改部分属性和分页查询功能,但仍然不支持删除商品的功能.这是因为商品总数是以一个自增数字记录的,且关联了新商品k ...

  9. php返回数据库查询时出现Resource id #2

    1.使用php调用MySQL数据库的过程是不是先用mysql_query(SELECT*...)或mysql_list_dbs()等查询函数返回结果指针(mysql查询函数中还有没有这样的返回指针函数 ...

  10. YII2学习第一天

    YII2学习第一天,之前稍微看了看TP,感觉和自己的理念不是很符合,然后转学YII2了. 使用的文档是https://github.com/yiisoft/yii2/tree/master/docs/ ...