1. 程式人生 > >Eclipse 切換 maven為阿里雲源

Eclipse 切換 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>/path/to/local/repo</localRepository>
  -->
<localRepository>C:\Users\zzzili\Documents\Eclipse\maven\mvn339Respo</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>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be 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>
     -->
	  <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </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>

將以上xml儲存為settings.xml檔案,並在eclipse中設定:


然後重啟eclipse

相關推薦

Eclipse 切換 maven阿里

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

linux 更換yum阿里

先看一下我的centos系統版本,用命令  cat /etc/issue 然後正式開始: 第一步先備份原有的映象檔案,防止出錯後無法恢復。 mv/etc/yum.repos.d/CentOS-Base.repo/ etc/yum.repos.d/CentOS-B

Ubuntu18.04下更改apt阿里

前言:看見Ubuntu新出了18.04版本感覺不錯,裝一個玩玩,雖然有很多教程可以參考,但我也給出一個不是很一樣的方案吧,儘量解釋的詳細一點。為了下載更方便,速度更快,我們往往在使用Linux系列系統時修改apt源為國內的源,一般選擇有阿里雲,豆瓣之類的,下面簡單說下如何更改

【Linux篇】配置apt-get阿里

1.到 /etc/apt/sources.list 裡全部成替換成如下內容 (內網) deb http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse d

切換Centos的yum,切換國內的阿里和網易163

將CentOS的系統的yum更換為網易和阿里雲的yum軟體安裝源 第一步:備份你的原映象檔案,以免出錯後可以恢復。 (使用mv命令,mv有兩個作用一個是移動,一個是重新命名,這裡用到的是重新命名

eclipseMaven映象更換阿里中央倉庫(阿里映象)

1、先安裝maven 下載如下圖的檔案型別,直接解壓就行了 2.0、下載mevan阿里映象檔案 點選下載 2.1、新增maven安裝目錄的conf目錄下的settings.xml檔案,新增如下資訊 3、在eclipse中修改maven的配置資訊,如下圖 4

切換ubuntu server的apt-get下載阿里國內地址

最近開始學習用ubuntu server,使用apt-get的時候,用的是us的源。 想改成國內阿里雲的源,找了一圈,沒找到具體的內容。我有裝桌面版的ubuntu,所以把桌面版的sources.list拷貝下來,然後上傳到server裡面去,實現了切換ubuntu的源到阿里

maven給預設中央倉庫設定映象阿里maven倉庫

maven3.5.4預設的中央倉庫central地址是  http://repo.maven.apache.org/maven2/ 但是網速一般,所以選擇國內阿里雲maven倉庫   在settings.xml 中配置    &nbs

CentOS 6.8配置yum阿里軟體

一、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.CentOS-Base.repo.backup 提示 “ mv: cannot stat `/etc/yum.repos.d/CentOS-Base.repo': No such file

CentOS7替換yum阿里

目前很多雲服務商,在提供系統的時候就已經替換為自家優化過的軟體源(比如阿里雲,騰訊雲),但是自有組裝或者是一些本地開發商,可能會使用官方軟體源,或者一些不靠譜的軟體源,我們需要將其替換為自己信任的軟體源。 安裝 WGET 安裝 wget 方便直接下載 CentOS-Base.repo 包,節省編輯的時間,放置

設定centos7.3的YUM國內阿里

# 備份原檔案 mv /etc/yum.repos.d/CentOS-Base.repo{,.bak} # 下載新的CentOS-Base.repo。 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirr

[CentOS7.5]Centos的yum更換國內的阿里

1、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/ CentOS 5

Maven映象更換阿里中央倉庫(精)

前言 maven倉庫預設在國外,使用難免很慢,尤其是下載依賴的時候,換為國內映象,讓你感受飛一般的感覺。國內支援maven映象的有阿里雲,開源中國等,這裡換為阿里雲的。 更換 修改maven配置檔案settings.xml (當然也可以在使用者home

centos6更新yum阿里

[1] 首先備份/etc/yum.repos.d/CentOS-Base.repomv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentO

Centos修改映象國內的阿里或者163等國內

最近都在使用國內的VPS。系統統一使用的都是Linux系統。但是,有一些服務商的系統給預設設定的是國外的。這樣就會導致下載速度緩慢。於是,找到了國內幾家比較熱門的映象點。奉獻給大家。下面的映象全部支援Linux的任何一個發行版的系統。小編就拿Centos來進行做教程。

超簡單將Centos的yum更換國內的阿里

自己的yum源不知道什麼時候給改毀了……搜到了個超簡單的方法將yum源更換為阿里的源 完全參考 1、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、

Linux修改yum阿里、網易、中國科技大學

1.阿里1.1備份當前的yum源mv /etc/yum.repos.d /etc/yum.repos.d.backup1.2下載新的CentOS-Base.repo 到/etc/yum.repos.d/CentOS 5wget -O /etc/yum.repos.d/Cent

更換本地的yum阿里提供的映象

Mirror Last update Help CPAN 2016-03-31 15:49:25 CRAN 2016-05-07 04:39:28 CTAN 2016-05-07 04:11:50 2016-05-07 01:23:34

Maven映象更換阿里中央倉庫

<mirrors> <mirror> <id>alimaven</id> <name>aliyun

Eclipse Maven倉庫阿里映象配置

小學期暑期實訓,內容是關於 Spring,SpringMVC… 今天第一天進行的是學習 maven 倉庫阿里雲映象配置,特此記錄下,分享給有需要的同學。 這裡先貼一下阿里雲映象網址:http://maven.aliyun.com/nexus/ 全球中央伺服