解決 SpringBoot 依賴導入過慢問題


在搭建Maven工程時,解決導入依賴過慢問題可以通過設置鏡像倉庫為阿里雲鏡像倉庫來解決,springboot項目解決此問題也一樣。

有兩種設置方法:

方法一:

在springboot項目的pom.xml文件中添加以下代碼(更改鏡像為阿里雲)

    <repositories>
        <repository>
            <id>aliyun-repos</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>aliyun-plugin</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

方法二:

在Maven的 config / setting.xml 文件中添加如下代碼(更改鏡像為阿里雲)

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

 


免責聲明!

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



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