zoukankan      html  css  js  c++  java
  • 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"后配置生效,重新编译即可。

  • 相关阅读:
    基于最大最小距离的分类数目上限K确定的聚类方法
    diff函数(matlab)
    CreateThread线程函数
    套接字基础
    基于TCP套接字实现的简单Demo
    使用httpwatch抓包
    TLV----Demo讲解
    关于位图边缘的检测定位
    从txt中读入数据到数组中(fscanf)
    C语言运算符的优先级
  • 原文地址:https://www.cnblogs.com/redhat0019/p/10669098.html
Copyright © 2011-2022 走看看