解决 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