maven将镜像站点改为中国开源镜像点
在Apache官网上下载bin文件,解压到相应目录。然后配置/etc/profile即可,环境变量名为M2_HOME,如下:(配置完后注意source /etc/profile)
#Maven
export M2_HOME=/usr/local/apache-maven-3.3.1
export PATH=$PATH:$M2_HOME/bin
由于编译时要下载很多东西,我们可以编辑maven\conf\settings.xml文件,将镜像站点改为中国开源镜像点,如下:
<mirrors>
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexusosc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
</mirrors>
和(注意不要把这个文件改错了)
<profiles>
<profile>
<id>jdk-1.7</id>
<activation>
<jdk>1.7</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>
</profiles>
然后将这个maven\conf\settings.xml文件拷贝到~/.m2文件夹下,保证用户每次使用maven都可以用到这个配置(.m2是个隐藏文件夹)
最新文章
- easyui与ueditor合用问题
- Could not publish server configuration for Tomcat v6.0 Server at localhost.
- 什么是 Help Desk?
- JavaScrip操作Cookie
- ZWave for Arduino
- 算法优化:rgb向yuv的转化最优算法,快得让你吃惊!
- MySQL锁详解
- Android仿微信朋友圈,全文收起功能,附源码
- Spring Cloud搭建微服务架构----前言
- 深入理解 Android 消息机制原理
- 学习笔记-JS公开课三
- 微信小程序点击列表添加 去除属性
- 廖雪峰Git入门教程
- RabbitMQ(3) Spring boot集成RabbitMQ
- Servlet执行流程和生命周期
- QT 小总结
- Atom与markdown
- LeetCode之有效括号
- Java 管道PipedInputStream PipedOutStream PipedReader PipedWriter
- 组学航母----OMICtools
热门文章
- C++中无法解析的外部符号错误
- [Javascript] Ternary Conditionals
- python下载文件的三种方法
- 【C#】利用JMail发送邮件
- hdu1874 畅通project续(求最短路径)
- Python编程-基础知识-List
- Java从零开始学三十三四(JAVA IO-流简述)
- java—(2)maven基本命令
- 算法笔记_195:历届试题 错误票据(Java)
- vb中adOpenKeyset, adLockOptimistic