idea自带的maven 配置阿里云中央仓库


1.进入到idea安装目录,找到\plugins\maven\lib 目录,可以看到maven有几个

2.修改maven2  或maven3 下conf目录下的settings.xml 文件如下

  找到mirrors,添加以下内容

<mirror>  
      <id>alimavenid>  
      <name>aliyun mavenname>  
          <url>http://maven.aliyun.com/nexus/content/groups/public/url>  
      <mirrorOf>centralmirrorOf>          
mirror>

<mirror>
    <id>ALiYunMavenid>
    <mirrorOf>*mirrorOf>
    <name>阿里云公共仓库name>
    <url>https://maven.aliyun.com/repository/publicurl>
mirror>

我这里是修改的maven3中的settings.xml

具体效果如下:

3.修改后保存,打开idea,菜单 file-settings,搜索maven,选择刚才修改的maven

4.设置好后保存,以后使用maven速度会提升很多倍




====================================

maven 配置指南

打开 maven 的配置文件( windows 机器一般在 maven 安装目录的 conf/settings.xml ),在标签中添加 mirror 子节点:

<mirror>
  <id>aliyunmavenid>
  <mirrorOf>*mirrorOf>
  <name>阿里云公共仓库name>
  <url>https://maven.aliyun.com/repository/publicurl>
mirror>

如果想使用其它代理仓库,可在节点中加入对应的仓库使用地址。以使用 spring 代理仓为例:

<repository>
  <id>springid>
  <url>https://maven.aliyun.com/repository/springurl>
  <releases>
    <enabled>trueenabled>
  releases>
  <snapshots>
    <enabled>trueenabled>
  snapshots>
repository>

在你的 pom.xml 文件节点中加入你要引用的文件信息:

<dependency>
  <groupId>[GROUP_ID]groupId>
  <artifactId>[ARTIFACT_ID]artifactId>
  <version>[VERSION]version>
dependency>

执行拉取命令:

mvn install



https://developer.aliyun.com/mvn/guide

阿里云云效 Maven 是什么

阿里云Maven中央仓库为 阿里云云效 提供的公共代理仓库,帮助研发人员提高研发生产效率,使用阿里云Maven中央仓库作为下载源,速度更快更稳定。 阿里云云效 是企业级一站式 DevOps 平台,覆盖产品从需求到运营的研发全生命周期,其中云效也提供了免费、可靠的Maven私有仓库 Packages,欢迎您体验使用。
仓库名称 阿里云仓库地址 阿里云仓库地址(老版) 源地址
central https://maven.aliyun.com/repository/central https://maven.aliyun.com/nexus/content/repositories/central https://repo1.maven.org/maven2/
jcenter https://maven.aliyun.com/repository/public https://maven.aliyun.com/nexus/content/repositories/jcenter http://jcenter.bintray.com/
public https://maven.aliyun.com/repository/public https://maven.aliyun.com/nexus/content/groups/public central仓和jcenter仓的聚合仓
google https://maven.aliyun.com/repository/google https://maven.aliyun.com/nexus/content/repositories/google https://maven.google.com/
gradle-plugin https://maven.aliyun.com/repository/gradle-plugin https://maven.aliyun.com/nexus/content/repositories/gradle-plugin https://plugins.gradle.org/m2/
spring https://maven.aliyun.com/repository/spring https://maven.aliyun.com/nexus/content/repositories/spring http://repo.spring.io/libs-milestone/
spring-plugin https://maven.aliyun.com/repository/spring-plugin https://maven.aliyun.com/nexus/content/repositories/spring-plugin http://repo.spring.io/plugins-release/
grails-core https://maven.aliyun.com/repository/grails-core https://maven.aliyun.com/nexus/content/repositories/grails-core https://repo.grails.org/grails/core
apache snapshots https://maven.aliyun.com/repository/apache-snapshots https://maven.aliyun.com/nexus/content/repositories/apache-snapshots https://repository.apache.org/snapshots/