Leif160519的blog Leif160519的blog

——————

目录
Maven设置国内源
/    

Maven设置国内源

Maven国内源设置 - 目前最优方案
目前国外的maven源访问非常慢,作为一个java开发者,是一件很痛苦的事,而国内的maven源,oschina已经关闭,目前最好的方式,就是使用阿里云的镜像:

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

以上需要配置在setting.xml文件中,一般在用户目录的【.m2】目录中,如果是mac,就是 ~/.m2/setting.xml,如果是windows,用户admin就在【用户\admin.m2\】目录中,如果没有这个文件,就需要在maven的配置文件中配置,然后创建一个。

这里说一下setting.xml的和项目pom.xml中的标签:
是镜像地址,为整个maven使用,一般每个国家地区配置,类似cdn的效果。是没有搭建私有仓库的公司首选。
是远程仓库,例如某个公司自己搭建的私有仓库地址,也是为了提高速度,有一定经济实力的公司在内网提供的仓库地址。


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Maven设置国内源
作  者Leif160519
出  处https://github.icu/articles/2019/08/22/1566473086309.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!