Maven使用阿里雲鏡像


Maven確實是個好用的東西,不過在國內的話下載速度不夠快,推薦使用阿里雲的鏡像,配置方法還是比較簡單,這里是全局的配置文件 settings.xml中的內容:

<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
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository />
    <interactiveMode />
    <usePluginRegistry />
    <offline />
    <pluginGroups />
    <servers />
    <mirrors>
        <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
    </mirrors> 
    <proxies />
    <profiles />
    <activeProfiles />
</settings>

新建一個settings.xml的文件,將上述內容復制到該文件中,然后放置在個人目錄下的 /.m2 目錄下,使用maven下載包的時候就是從阿里雲下載了,速度會明顯快很多的。

這里參考了@極客堂的內容,詳情請點擊 這里查看。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM