IDEA给中央maven库添加阿里云镜像具体过程

IDEA给中央maven库添加阿里云镜像

IDEA使用maven工程的时候需要导入jar包坐标,maven工程自动下载相关jar包,但是下载实在是太慢,所以需要自己去添加一个阿里云镜像去提高下载速度。
第一步:配置自己的中央maven库,file =》setting =》Bulid =》Build Tools=》Maven
此处图片中选择的都是自己安装IDEA的位置,不要选择IDEA自带的maven库。这三个位置最好就是自己安装的位置中的文件。
搭建自己的中央mavenkuu
如果没有哦找到user setting file,按照下面图片的操作右键点击项目名称可以找到一个create setting xml或者open setting xml
创建自己的配置文件

配置完成后,就可以在setting.xml中添加阿里云镜像了。在setting.xml文件中找到mirrors,在里面添加阿里云镜像下面的代码即可,这里的代码不只有阿里云镜像,还有我添加的其他镜像配置。

<mirrors>
  <!-- mirror
   | Specifies a repository mirror site to use instead of a given repository. The repository that
   | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
   | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
   |
  <mirror>
    <id>mirrorId</id>
    <mirrorOf>repositoryId</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://my.repository.com/repo/path</url>
  </mirror>
   -->


  <!-- 阿里云镜像 -->
  <mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>https://maven.aliyun.com/nexus/content/repositories/central/</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

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

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

  <mirror>
    <id>nexus-public-snapshots</id>
    <mirrorOf>public-snapshots</mirrorOf>
    <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
  </mirror>

  <mirror>
    <id>nexus</id>
    <name>internal nexus repository</name>
    <url>https://repo.maven.apache.org/maven2</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

  <mirror>
    <id>uk</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://uk.maven.org/maven2/</url>
  </mirror>

  <mirror>
    <id>CN</id>
    <name>OSChina Central</name>
    <url>http://maven.oschina.net/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
  </mirror>
</mirrors>

到这,阿里云镜像就添加完了,我们就可以看见maven工程下载jar速度快了很多。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

likehack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值