ubuntu修改maven源地址

ubuntu下安裝了maven之後,默認的源速度太慢,常常連不上,因此改爲國內的源.apache

找到配置文件,路徑:ubuntu

/usr/share/maven/conf/settings.xmlmaven

備份後,把其中的內容改成:url

<?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">

    <pluginGroups>
    </pluginGroups>

    <proxies>
    </proxies>

    <servers>
    </servers>

    <mirrors>
        <mirror>
            <id>nexus-aliyun</id>
            <mirrorOf>central</mirrorOf>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
    </mirrors>


    <profiles>
        <profile>
            <id>aliyun</id>
            <!-- repositories and pluginRepositories here-->
            <repositories>
                <repository>
                    <id>nexus-aliyun</id>
                    <name>Nexus aliyun</name>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <activeProfiles>
        <activeProfile>aliyun</activeProfile>
    </activeProfiles>
</settings>

再試,下載速度飛快code

相關文章
相關標籤/搜索