zoukankan      html  css  js  c++  java
  • eclipse下配置maven的下载镜像

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

    2.关闭窗口重新打开过后会出现"open file",点击"open file",在eclipse中打开该配置文件,出现"could not read settings.xml"不需要管。直接在eclipse中添加内容。

    3.复制下列内容到settings.xml中。<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。

  • 相关阅读:
    软件/环境的注册码
    js图片延迟加载如何实现
    http状态码
    关于深拷贝(含数组对象)
    javascript继承方式详解
    使用寄生构造函数 创建类
    前端知识点大全【转载】
    统一addEventListener与attachEvent中this指向问题
    sublime text全程指南【转载】
    函数防抖与节流[转载]
  • 原文地址:https://www.cnblogs.com/dbutil/p/8509650.html
Copyright © 2011-2022 走看看