【Maven】Maven配置国内镜像

文章目录

  • 1. 配置maven的settings.xml文件
    • 1.1. 先把镜像mirror配置好
    • 1.2. 再把仓库配置好
  • 2. 在idea中引用
  • 3. 参考资料

网上配置maven国内镜像的文章很多,为什么选择我,原因是:一次配置得永生、仓库覆盖广、仓库覆盖全面、作者自用的配置。

1. 配置maven的settings.xml文件

1.1. 先把镜像mirror配置好

复制就完事了


	
      aliyun-central
      
      central
      aliyun central
      https://maven.aliyun.com/repository/central
    

    
        repo1
        central
        Human Readable Name for this Mirror.
        http://repo1.maven.org/maven2/
    

    
        repo2
        central
        Human Readable Name for this Mirror.
        http://repo2.maven.org/maven2/
    

1.2. 再把仓库配置好

复制就完事了

    
      
      jdk1.8
      
        true
        1.8
      
      
        1.8
        1.8
        1.8
      


      
      
        
            aliyun-public
            aliyun public
            https://maven.aliyun.com/repository/public
            
                true
            
            
                true
            
        

        
            aliyun-spring
            aliyun spring
            https://maven.aliyun.com/repository/spring
            
                true
            
            
                true
            
        

        
            aliyun-spring-plugin
            aliyun spring-plugin
            https://maven.aliyun.com/repository/spring-plugin
            
                true
            
            
                true
            
        

        
            aliyun-apache-snapshots
            aliyun apache-snapshots
            https://maven.aliyun.com/repository/apache-snapshots
            
                true
            
            
                true
            
        

        
            aliyun-google
            aliyun google
            https://maven.aliyun.com/repository/google
            
                true
            
            
                true
            
        

        
            aliyun-gradle-plugin
            aliyun gradle-plugin
            https://maven.aliyun.com/repository/gradle-plugin
            
                true
            
            
                true
            
        

        
            aliyun-jcenter
            aliyun jcenter
            https://maven.aliyun.com/repository/jcenter
            
                true
            
            
                true
            
        

        
            aliyun-releases
            aliyun releases
            https://maven.aliyun.com/repository/releases
            
                true
            
            
                true
            
        

        
            aliyun-snapshots
            aliyun snapshots
            https://maven.aliyun.com/repository/snapshots
            
                true
            
            
                true
            
        

        
            aliyun-grails-core
            aliyun grails-core
            https://maven.aliyun.com/repository/grails-core
            
                true
            
            
                true
            
        

        
            aliyun-mapr-public
            aliyun mapr-public
            https://maven.aliyun.com/repository/mapr-public
            
                true
            
            
                true
            
        
      
    

2. 在idea中引用

如下图在框框处引用你自己的maven本地地址,点击应用点击OK。然后重新刷新您的maven项目看看是不是在下载jar包。

【Maven】Maven配置国内镜像_第1张图片

3. 参考资料

idea不自动生成target

Maven配置国内镜像

你可能感兴趣的:(Maven,maven,java)