1. 程式人生 > >國內maven遠端倉庫配置

國內maven遠端倉庫配置

<?xml version="1.0" encoding="UTF-8"?>


<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at


    http://www.apache.org/licenses/LICENSE-2.0


Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->


<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.home}/conf/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>D:\\programs\\maven\\repo</localRepository>
 -->
  <localRepository>d:/m2/repository</localRepository>


  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->


  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->


  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>


  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>


  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->


    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
<server> 
       <id>tomcat7</id> 
       <username>admin</username> 
       <password>admin</password> 
    </server> 
  </servers>


  <!-- mirrors
   | This is a list of mirrors to kbe used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <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>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
 <!--
http://mvnrepository.com/
http://search.maven.org/
http://maven.ibiblio.org/maven2/
http://repo1.maven.org/maven2/
http://repository.sonatype.org/content/groups/public/
http://people.apache.org/repo/m2-snapshot-repository/
http://people.apache.org/repo/m2-incubating-repository/
     -->
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
     <mirror>
        <id>nexus-ibiblio</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus ibiblio</name>
        <url>http://maven.ibiblio.org/maven2/</url>
    </mirror> 
     <mirror>
        <id>maven.org</id>
        <mirrorOf>*</mirrorOf>
        <name>maven.org</name>
        <url>http://repo1.maven.org/maven2/</url>
    </mirror> 
  </mirrors>


  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
      <id>jdk-1.4</id>


      <activation>
        <jdk>1.4</jdk>
      </activation>


      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->


    <!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>


      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>


      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>


  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>

相關推薦

國內maven遠端倉庫配置

<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor licen

maven本地倉庫配置

repos xml文件 cal 應該 tor 指定 位置 pos 系統 1、創建本地倉庫目錄(其實就是在指定位置創建文件夾) 2、配置本地倉庫(localRepository),如果不配置maven將創建默認倉庫,見截圖第52行會在系統盤下進行創建,為便於管理 應該自行配

Maven本地倉庫配置及修改Maven的本地倉庫路徑

1.修改Jar包在本地的儲存路徑 安裝Maven後我們會在使用者目錄下發現.m2 資料夾。預設情況下,該資料夾下放置了Maven本地倉庫.m2/repository。所有的Maven構件(artifact)都被儲存到該倉庫中,以方便重用。但是windows使用者的作業系統都安裝在C盤,把M

maven 遠端倉庫常用映象

<mirror> <id>175.6.27.51 </id> <mirrorOf>*</mirrorOf> <name>wtx mirror</name> <

Git 遠端倉庫配置(2)

1.gitHub新增 SSH Key 本地Git倉庫和github倉庫之間的傳輸是通過SSH加密的所以需要作如下設定. 第一步:建立SSH Key。Git客戶端工具進入使用者本地創庫主目錄下,通過命令( ssh - keygen -t rsa -C "815*****[email

maven專案對於maven遠端倉庫沒有資源的解決辦法

下載資源到本地 方法一:dependency scope 是system 型別 <dependency> <groupId>edu.ucar</groupId> <artifactId>netcdfAl

阿里Maven中心倉庫配置

<mirror>             <id>nexus-aliyun</id>             <mirrorOf>central</mirrorOf>             <name>

maven專案倉庫配置以及依賴下載設定

首先要有maven的包 在eclipse裡面開啟window視窗,開啟perferences設定,找到maven目錄下的User setting 這裡的配置就是找到maven包裡面的conf\settings.xml 下面這個Local Repository先不管,這個是依賴下載後的存放路徑(也

maven倉庫配置

<profile> <!-- id必須唯一 --> <id>alibaba central</id> <repositories>

gradle本地、遠端倉庫配置

本地倉庫配置 配置環境變數GRADLE_USER_HOME,並指向你的一個本地目錄,用來儲存Gradle下載的依賴包。 遠端倉庫配置 一般Gradle、maven從中央倉庫mavenCentral() http://repo1.maven.org/

阿里雲maven中央倉庫配置

方法1:在MAVEN_HOME/conf下的settings.xml的<mirrors>標籤中新增如下配置:                 <mirror>        

Git遠端倉庫 配置SSH

本地Git倉庫和GitHub倉庫之間的傳輸是通過SSH加密的,所以,需要一點設定 第1步:建立SSH Key。 在使用者主目錄下,看看有沒有.ssh目錄,如果有,再看看這個目錄下有沒有id_rsa和id_rsa.pub這兩個檔案,如果已經有了,可直接跳到下一步。如果沒

maven遠端倉庫和映象

http://blog.csdn.net/zyxnetxz/article/details/5709196 http://www.blogjava.net/baoyaer/articles/355040.html http://www.cnblogs.com/jerome-

MAC下maven本地倉庫配置

本地倉庫是遠端倉庫的一個緩衝和子集,當你構建Maven專案的時候,首先會從本地倉庫查詢資源,如果沒有,那麼Maven會從遠端倉庫下載到你本地倉庫。這樣在你下次使用的時候就不需要從遠端下載了。如果你所需要的jar包版本在本地倉庫沒有,而且也不存在於遠端倉庫,Maven在構建

maven國內快速映象,國內maven中央倉庫地址

<!-- 中央倉庫地址 --> <mirrors> <mirror> <id>alimaven</id>

maven倉庫配置

<profile>       <id>jdk18</id>       <activation><activeByDefault>true</activeByDefault>         <jdk>1.8</jdk

maven 本地倉庫配置Windows環境

純手打,轉載務請附上本文網址!!! maven是很好用的,但是初次接觸maven卻很難弄, 首先來講講maven本地倉庫的配置吧 首先是maven包: http://download.csdn.net/download/xianzhixianzhixian/1023

pom.xml中新增阿里雲Maven中央倉庫配置

<repositories><!-- 程式碼庫 --> <repository> <id>maven-ali</id>

配置Maven的 本地倉庫遠端倉庫(私服)

maven中並沒有我們開發所需的jar包,只是存有jar包的座標,jar包是存於本地倉庫/遠端倉庫/中央倉庫中的。當我們啟動maven工程時,專案會根據maven中的座標去查詢對應的jar包。 查詢maven工程中存放座標的配置檔案:開啟maven的安裝路檔案

03-2.Maven專案怎麼呼叫遠端倉庫,及映象配置mirrors的使用

Maven 有個超級POM,它預設的位置在:maven-model-builder-3.3.9.jar\org\apache\maven\model\pom-4.0.0.xml,裡面配置了maven預設呼叫遠端倉庫和外掛倉庫的地址,如下: <repo