maven 配置阿里云镜像仓库

转载

我个人感觉好像没什么用,你们可以参考一下,

在构建maven项目的时候,使用maven默认的仓库是海外的仓库,国内下载jar包会非常非常慢,使用国内的阿里镜像仓库的话速度会非常的快。

虽然网上已经有很多了,但是自己也记录一下,方便下次查询。

maven配置阿里云镜像仓库,可有两种方法。

一是配置setting.xml文件的镜像地址。

配置如下:

找到maven的配置文件,如 E:\apache-maven-3.6.0\conf 下的 settings.xml文件
找到节点,添加如下内容即可


    
        nexus-aliyun
        central
        Nexus aliyun
        http://maven.aliyun.com/nexus/content/groups/public
    
  

2是直接在pom.xml文件中设置,修改uri为阿里云的地址

http://maven.aliyun.com/nexus/content/groups/public

http://maven.aliyun.com/nexus/content/groups/public
maven 配置阿里云镜像仓库_第1张图片

如此即可,下载依赖包就快的飞起

你可能感兴趣的:(java)