zoukankan      html  css  js  c++  java
  • Maven 镜像<mirror>

    使用镜像
    如果你的地理位置附近有一个速度更快的central镜像,或者你想覆盖central仓库配置,或者你想为所有POM使用唯一的一个远程仓库(这个远程仓库代理的所有必要的其它仓库),你可以使用settings.xml中的mirror配置。
    以下的mirror配置用maven.net.cn覆盖了Maven自带的central:

    <settings>  
    ...  
      <mirrors>  
        <mirror>  
          <id>maven-net-cn</id>  
          <name>Maven China Mirror</name>  
          <url>http://maven.net.cn/content/groups/public/</url>  
          <mirrorOf>central</mirrorOf>  
        </mirror>  
      </mirrors>  
    ...  
    </settings>

    这里唯一需要解释的是<mirrorOf>,这里我们配置central的镜像,我们也可以配置一个所有仓库的镜像,以保证该镜像是Maven唯一使用的仓库:

    <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>nexus</id>  
        <mirrorOf>*</mirrorOf>  
        <name>Nexus Mirror</name>  
        <url>http://xx.xx/nexus/content/groups/public</url>  
      </mirror>  
    </mirrors> 
    <settings>  
    ...  
      <mirrors>  
        <mirror>  
          <id>my-org-repo</id>  
          <name>Repository in My Orgnization</name>  
          <url>http://192.168.1.100/maven2</url>  
          <mirrorOf>*</mirrorOf>  
        </mirror>  
      </mirrors>  
    ...  
    </settings>  
  • 相关阅读:
    css3 @page
    Python:GUI
    Python: simple drawings
    JQuery 实现多个checkbox 只选中一个
    pgwSlideshow.js
    Html5: Drawing with text
    HTML5 Video player jQuery plugin
    cSharp:反射 Reflection
    机器学习基础---无监督学习之异常检测
    机器学习作业---主成分分析PCA
  • 原文地址:https://www.cnblogs.com/frankcui/p/10641318.html
Copyright © 2011-2022 走看看