[转]使用maven镜像
2015-06-29 14:49
232 查看
综述
用maven做项目,最郁闷的莫过于某些依赖库下载不了。被墙了,你懂的。使用maven镜像仓库及其重要,特别是国内的镜像,可以有效缓解被墙疼痛。常用的镜像
国外镜像
ibiblio.org<mirror> <id>ibiblio</id> <mirrorOf>central</mirrorOf> <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </mirror>
jboss
<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>
repo2
<mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror>
uk.maven.org
<mirror> <id>ui</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://uk.maven.org/maven2/</url> </mirror>
国内镜像
oschina.net<mirror> <id>nexus-osc</id> <mirrorOf>*</mirrorOf> <name>Nexus osc</name> <url>http://maven.oschina.net/content/groups/public/</url> </mirror>
net.cn
<mirror> <id>net-cn</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://maven.net.cn/content/groups/public/</url> </mirror>
使用镜像
下文以oschina.net的镜像为例子.1.Maven 的安装目录下的 conf 文件下有个
settings.xml文件,编辑该文件
2.在<mirrors>中插入:
<mirror> <id>nexus-osc</id> <mirrorOf>*</mirrorOf> <name>Nexus osc</name> <url>http://maven.oschina.net/content/groups/public/</url> </mirror>
3.这里是配置 Maven 的 mirror 地址指向OSChina 的 Maven 镜像地址。 在执行 Maven 命令的时候, Maven 还需要安装一些插件包,这些插件包的下载地址也让其指向 oschina.net 的 Maven 地址。在<profiles>中插入:
<profile> <id>jdk-1.4</id> <activation> <jdk>1.4</jdk> </activation> <repositories> <repository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> ps:http://www.waylau.com/use-maven-mirrors/ http://search.maven.org/#browse[/code]
相关文章推荐
- 运维之Linux服务器监控方案
- Advanced Rest Client 模拟用户请求工具
- Oracle函数返回表类型
- android 关于将应用添加到系统的 分享.. 或者 发送到.. 中
- java学习之旅42--面向对象_15_继承_组合
- Android初学笔记——xml文件的读写
- Python正则表达式指南
- 警告: Unsupported configuration plain style unsupported in a navigation item
- 在Linux系统的命令行中为MySQL创建用户的方法
- Linux slab 分配器剖析
- SEGUE
- Import/Export导入导出数据(理论)
- Linux关闭防火墙命令
- 影视作品烂到至高无上的境界不是槽点满满
- PP几个表关系
- UVA 575 Skew Binary (水)
- mysql创建索引大全
- HBase学习总结(2):HBase介绍及其基本操作
- Linux环境下,通过FTP下载7z压缩包出现数据丢失
- 数据结构:回溯法与树的遍历