- "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 thisworkfor additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not usethisfile exceptin 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.
- -->isthe configuration filefor Maven. It can be specified at two levels:
- |
- |1. User Level. This settings.xml file provides configurationfor a single user,
- | andisnormally providedin${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 configurationfor 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 sectionsin this sample file are intended to give you a running start at
- | getting the mostoutof your Maven installation. Where appropriate, thedefault| values (values used when the settingis not specified) are provided.
- |
- |-->"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: ~/.m2/repository
- /path/to/local/repo
- --> interactiveMode
- | This will determine whether maven prompts you when it needs input. Ifsettofalse,
- | maven will use a sensibledefaultvalue, perhaps based on some other setting,for| the parameterin question.
- |
- | Default:true
- true--> 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
- false--> pluginGroups
- | Thisis 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" ifthese are not already containedin the list.
- |-->
- pluginGroup
- | Specifies a further group identifier to usefor plugin lookup.
- com.your.plugins
- --> proxies
- | Thisisa list of proxies which can be used onthis machine to connect to the network.
- | Unless otherwise specified (by system property or command-lineswitch), the first proxy
- | specificationin thislist markedas active will be used.
- |-->
- proxy
- | Specificationforone proxy, to be usedin connecting to the network.
- |
- optional
- truehttp
- proxyuser
- proxypass
- proxy.host.net
- 80local.net|some.host.com
- --> servers
- | Thisisa 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.
- |-->
- 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.
- |
- deploymentRepo
- repouser
- repopwd
- -->using keys to authenticate.
- siteServer
- /path/to/private/key
- optional; leave empty ifnot used.
- --> mirrors
- | Thisisa list of mirrors to be usedindownloading artifactsfrom remote repositories.
- |
- | It works likethis: a POM may declare a repository to usein 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 referencefor that
- | repository, to be usedas an alternate download site. The mirror site will be the preferred
- | serverfor that repository.
- |-->
- mirror
- | Specifies a repository mirror site to use instead of a given repository. The repository that
- |thismirror serves has an ID that matches the mirrorOf element ofthis mirror. IDs are used
- |forinheritance and direct lookup purposes, and must be unique across theset of mirrors.
- |
- mirrorId
- repositoryId
- Human Readable Name for thisMirror.
- http://my.repository.com/repo/path</url>-->
- alimaven
- aliyun maven
- http://maven.aliyun.com/nexus/content/groups/public/</url>central
- CN
- OSChina Central
- http://maven.oschina.net/content/groups/public/</url>central
- nexus
- internalnexus repository//192.168.1.100:8081/nexus/content/groups/public/</url>-->http://repo.maven.apache.org/maven2</url>central profiles
- | Thisisa list of profiles which can be activatedin a variety of ways, and which can modify
- | the build process. Profiles providedinthe settings.xml are intended to provide local machine-
- | specific paths and repository locations which allow the build to workin the local environment.
- |
- | For example,ifyou have an integration testing plugin - like cactus - that needs to knowwhere| your Tomcat instanceisinstalled, you can provide a variable here such that the variableis| dereferenced during the build process to configure the cactus plugin.
- |
- | As noted above, profiles can be activatedina variety of ways. One way - the activeProfiles
- | section ofthisdocument (settings.xml) - will be discussed later. Another way essentially
- | relies on the detection of a system property, either matching a particular valuefor 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 buildisexecuted on a JDK version of'1.4.2_07'.
- | Finally, the list of active profiles can be specified directlyfrom the command line.
- |
- | NOTE: For profiles definedin the settings.xml, you are restricted to specifying only artifact
- | repositories, plugin repositories, and free-form properties to be usedas configuration
- | variablesforpluginsin the POM.
- |
- |-->
- profile
- | Specifies asetof introductions to the build process, to be activatedusing one or more of the
- | mechanisms described above. For inheritance purposes, and to activate profiles via
- | or the command line, profiles have to have an ID thatis unique.
- |
- | An encouraged best practiceforprofile identificationis to use a consistent naming convention
- |forprofiles, suchas 'env-dev','env-test','env-production','user-jdcasey','user-brett', etc.
- | This will make it more intuitive to understand what thesetof introduced profilesis 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.
- jdk-1.4
- 1.4
- jdk14
- Repository forJDK1.4builds
- http://www.myhost.com/maven/jdk14</url>
- defaultalways
- -->isanother profile, activated by the system property'target-env'with a value of'dev',
- | which provides a specific path to the Tomcat instance. To usethis, your plugin configuration
- | might hypothetically look like:
- |
- | ...
- |
- | org.myco.myplugins
- | myplugin
- |
- |
- | ${tomcatPath}
- |
- |
- | ...
- |
- | NOTE: If you just wanted to injectthisconfiguration whenever someoneset 'target-env' to
- | anything, you could just leave off the inside the activation-property.
- |
- env-dev
- target-env
- dev
- /path/to/tomcat/instance
- --> activeProfiles
- | List of profiles that are activefor all builds.
- |
- alwaysActiveProfile
- anotherAlwaysActiveProfile
- -->
来源: http://www.bubuko.com/infodetail-1967306.html