Ubuntu 14.04 下解决maven访问速度慢问题

参考:

maven国内镜像(maven下载慢的解决方法)

maven中央仓库访问速度太慢的解决办法

Ubuntu 14.04 下解决maven访问速度慢问题

在启动OVX的时候,由于sh脚本中需要使用maven来packaging OVX,导致半天出不来结果。

解决方法:

1.进入/usr/share/maven/conf目录;

2.修改settings.xml文件,在<mirrors>后加上:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    
        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
    
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
    </mirrors> 
</settings>

2017.6.11

原文地址:https://www.cnblogs.com/qq952693358/p/6985767.html