在搭建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>

 

相关文章:

  • 2022-12-23
  • 2021-11-14
  • 2021-07-25
  • 2021-08-08
  • 2019-03-04
  • 2021-04-06
  • 2021-06-08
猜你喜欢
  • 2021-05-04
  • 2021-09-04
  • 2021-04-06
  • 2021-09-03
  • 2021-08-24
  • 2022-02-19
  • 2022-12-23
相关资源
相似解决方案