解決Maven配置了阿里鏡像后仍從中央倉庫下載依賴的問題


 

今天從github上拉了一個項目,我maven配置的是阿里的鏡像,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>

 


免責聲明!

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



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