maven的配置文件中已經配置了阿里雲鏡像但是仍然會從中央倉庫下載maven依賴很慢。解決方案


配置阿里雲鏡像之后依然從中央倉庫下載鏡像的問題解決方案:

在pom.xml文件中加上下面的代碼即可。

<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>false</enabled>
        </snapshots>
    </repository>
</repositories>


上述解決方案的前提是已經在maven中配置好了阿里雲鏡像。:
在maven/.m2/repository/settings.xml文件以及maven/apache-maven-3.5.4/conf/settings.xml文件中加上阿里雲的鏡像:

 <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>


免責聲明!

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



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