maven项目快速导入工程依赖库(使用阿里云镜像)

在首次构建maven项目,
或者快速构建springboot项目,
你会发现,下面的依赖导入速度感人,
那是因为在国内访问maven的依赖库速度感人

以前不知道,现在知道有镜像这东西后,就要快速利用起来

下面是使用阿里云镜像的方法

第一步:修改 maven 根目录下的 conf 文件夹中的 setting.xml 文件,在 mirrors 节点上,添加内容如下

在< mirrors >< /mirrors >里面添加

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

第二步:再pom文件里面添加

<repositories>  
        <repository>  
            <id>alimaven</id>  
            <name>aliyun maven</name>  
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
            <releases>  
                <enabled>true</enabled>  
            </releases>  
            <snapshots>  
                <enabled>false</enabled>  
            </snapshots>  
        </repository>  
</repositories>

后从新导入依赖,你就会发现速度一下子嗖嗖就好了

以后需要导入依赖包的画就会很快了,不需要看那感人速度o(╥﹏╥)o

发布了14 篇原创文章 · 获赞 13 · 访问量 1762

猜你喜欢

转载自blog.csdn.net/weixin_43157543/article/details/104361345