IDEA中设置maven阿里云镜像

背景

maven下载依赖库太慢了.

解决方案

设置阿里云镜像.

  1. 打开IDEA设置界面,搜索maven,勾选“User settigns file”后面的复选框
    IDEA中设置maven阿里云镜像_第1张图片
  2. 在对应路径下新建settings.xml文件,内容如下:



    
        
            alimaven
            central
            aliyun maven
            http://maven.aliyun.com/nexus/content/repositories/central/
        
        
            alimaven
            aliyun maven
            http://maven.aliyun.com/nexus/content/groups/public/
            central
        
        
            central
            Maven Repository Switchboard
            http://repo1.maven.org/maven2/
            central
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
        
            ibiblio
            central
            Human Readable Name for this Mirror.
            http://mirrors.ibiblio.org/pub/mirrors/maven2/
        
        
            jboss-public-repository-group
            central
            JBoss Public Repository Group
            http://repository.jboss.org/nexus/content/groups/public
        
        
            google-maven-central
            Google Maven Central
            https://maven-central.storage.googleapis.com
            
            central
        
        
        
            maven.net.cn
            oneof the central mirrors in china
            http://maven.net.cn/content/groups/public/
            central
        
    

  1. 重启IDEA.
    如果编译或者同步时显示如下包含了aliyun.com的url就表示ok了.
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/jetbrains/kotlin/kotlin-maven-plugin/1.3.60/kotlin-maven-plugin-1.3.60.pom

你可能感兴趣的:(Kotlin后端开发)