• Eclipse下,修改MAVEN 中央仓库地址,解决maven下载慢问题


    作用于所有工作空间:

    1、逐项打开:eclipse->preference->Maven->User Settings。按窗口中的User Settings文本框显示的路径,创建settings.xml文件,或修改路径后创建文件。

    2、关闭窗口后重新打开,点击“open file”,在IDE中打开该配置文件,出现“could not read settings.xml”不必管。

    3、复制下列内容至配置文件,其中<mirror></mirror>部分为国内镜像。

    <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
        <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>alimaven</id>
                <name>aliyun maven</name>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</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>
            
              <mirror>
                <id>nexus</id>
                <name>internal nexus repository</name>
                <url>http://repo.maven.apache.org/maven2</url>
                <mirrorOf>central</mirrorOf>
              </mirror>
        </mirrors>
     
        <profiles>
            <profile>
                <id>default</id>
                <repositories>
                    <repository>
                        <id>nexus</id>
                        <name>local private nexus</name>
                        <url>http://maven.oschina.net/content/groups/public/</url>
                        <releases>
                            <enabled>true</enabled>
                        </releases>
                        <snapshots>
                            <enabled>false</enabled>
                        </snapshots>
                    </repository>
                </repositories>
                <pluginRepositories>
                    <pluginRepository>
                        <id>nexus</id>
                        <name>local private nexus</name>
                        <url>http://maven.oschina.net/content/groups/public/</url>
                        <releases>
                            <enabled>true</enabled>
                        </releases>
                        <snapshots>
                            <enabled>false</enabled>
                        </snapshots>
                    </pluginRepository>
                </pluginRepositories>
            </profile>
        </profiles>
    </settings>

    4、"apply"后配置生效,重新编译即可。

  • 相关阅读:
    Java 异常
    【转】Java 内部类总结
    【转】Java中的static关键字解析
    【转】事务及事务隔离级别
    【转】事务并发的问题
    【转】hibernate对象三种状态
    iOS指南针
    CoreLocation 定位
    swift 2.2 语法 (下)
    swift 2.2 语法 (中)
  • 原文地址:https://www.cnblogs.com/redhat0019/p/10669098.html
Copyright © 2020-2023  润新知