Detailed settings.xml maven ---

 

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

<Settings xmlns = "http://maven.apache.org/POM/4.0.0"
xmlns: xsi = "HTTP: //www.w3 .org / 2001 / "the XMLSchema-instance
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">: the xsi the schemaLocation = "

<! - the local warehouse. This value represents the local repository system to build the path. The default value is $ {user.home} /. M2 / repository. ->
<localRepository> usr / local / Maven </ localRepository>

<-! Maven need for user interaction and to obtain input. If Maven requires user interaction and to obtain input, it is set to true, should conversely to false. The default is true. ->
<interactiveMode> to true </ interactiveMode>

<-! Maven plugin-registry.xml need to use file management plug-in version. ->
<! - If set to true, then {user.home} / m2 at a plugin-registry.xml need to manage the plugin version ->
<! - default is false. ->


<! - whether expressed Maven needs to run in offline mode. If the build system needs to run in offline mode, for the true, the default is false. ->
<! - when, due to the network setting problem or safety factors built when the server can not connect to a remote repository, the configuration is very useful. ->
<Offline> false </ Offline>

<-! When the tissue plug-Id (groupId) does not explicitly provide for a list of search plugins Organization Id (groupId) of. ->
<! - This element contains a pluginGroup list of elements, each element contains a sub-organization Id (groupId). ->
<! - when we use a plug-in, and it does not provide tissue Id (groupId) in the command line, Maven will use the list. ->
<! - By default, the list contains org.apache.maven.plugins. ->
<pluginGroups>

<-! Plugin organization Id (the groupId) ->
<pluginGroup> org.codehaus.mojo </ pluginGroup>

</ pluginGroups>

<-! To configure the different agents, multi-agent profiles you can cope with a laptop or mobile device work environment: through a simple setup profile id can easily replace the entire proxy configuration. ->
<Proxies>

<-! Required information when the proxy element contains the proxy configuration ->
<Proxy>

<! - unique delimiter agents, agents used to distinguish one element. ->
<ID> MyProxy </ ID>

<! - whether the agent is active in that. true then activate the agent. When we declare a group of agents, and sometime only need to activate a proxy when the element can be put to use. ->
<the Active> to true </ the Active>

<-! Agency agreement. Protocol: // hostname: port, separated into discrete elements to make configuration easier. ->
<Protocol> HTTP: // ... </ Protocol>

<- Agent host name!. Protocol: // hostname: port, separated into discrete elements to make configuration easier. ->
<Host> proxy.somewhere.com </ Host>

<-! Proxy port. Protocol: // hostname: port, separated into discrete elements to make configuration easier. ->
<Port> 8080 </ Port>

<-! Proxy user name, user name and password represents the proxy server authentication login name and password. ->
<username> proxyuser </ username>

<-! Proxy password, user name and password represents the proxy server authentication login name and password. ->
<password> somepassword </ password>

<-! Should not be a proxy list of host names. The list delimiter designated by the proxy server; examples use a pipe delimiter, separated by commas are also common. ->
<nonProxyHosts> * google.com |. Ibiblio.org </ nonProxyHosts>

<



<! - some of the settings to configure the service side. Some settings, such as security certificates and should not be distributed with pom.xml. This type of information should exist to build settings.xml file on the server. ->
<Servers>

<-! Required information element contains the server configuration server ->
<server>

<-! This is the server's id (note not a user login id), and the id of the repository elements distributionManagement the id to match. ->

<! - Distribution Manager will use the project labeled jar package, upload directly to a designated server ->
   < distributionManagement>
     <- - official version!> < Repository> <- Nexus Server Username:! In settings .xml in <server> of the above mentioned id -> < the above mentioned id> Maven-Releases </ the above mentioned id> <- the name their own definition ->! < name> Nexus Release Repository </ name> < url> HTTP: //192.168 .1.109: 8081 / Repository / Maven-Releases / </ url> </ Repository> <- snapshot <snapshotRepository> <id> maven- snapshots </ id> <name> Nexus snapshot Repository </ name> <url>! http://192.168.1.109:8081/repository/maven-snapshots/ </ url> </snapshotRepository>--> </distributionManagement>

<servers>
    <server>
      <id>maven-releases</id> <username>admin</username> <password>密碼就不暴露了</password> </server> <server> <id>maven-snapshots</id> <username>admin </username> <password>密碼就不暴露了</password> </server> <server> <id>maven-third-part</id> <username>admin </username> < Password> password is not exposed </ password> </ Server> </ Servers>



<-! Authentication user name. Authentication username and password authentication means that the server requires authentication login name and password. ->
<username> my_login </ username>

<-! Authentication password. Authentication username and password authentication means that the server requires authentication login name and password. ->
<password> my_password </ password>

<-! Private key used for authentication positions. And similar to the first two elements, the position of the private key password and specify a path to the private key (default is /home/hudson/.ssh/id_dsa) and, if necessary, a key ->
<! - the future passphrase and password elements may be extracted to the outside, but they must be declared in the form of plain text in the settings.xml file. ->
. <PrivateKey>} $ {usr.home / SSH / id_dsa </ privateKey>

<-! Authentication password to use when the private key. ->
<passphrase> some_passphrase </ passphrase>

<-! Permissions when files are created. If you create a repository file or directory at deployment time, this time we can use permissions (permission). ->
<! - the legal values of these two elements is a three-digit number, which corresponds to the unix file system permissions, such as 664 or 775. ->
<filePermissions> 664 </ filePermissions>

<-! Permissions of the directory is created. ->



<the Configuration> </ the Configuration>

</ Server>

</ Servers>

<-! download mirror list configured for the repository list. ->
<Mirrors>

<-! To download a given warehouse mirror. ->
<Mirror>

<-! Unique identifier for the image. id used to distinguish one mirror element. ->
<the above mentioned id> planetmirror.com </ the above mentioned id>

<-! Image name ->
<name> PlanetMirror Australia </ name>

<-! The mirror URL. Construction of the system will give priority to the use of the URL, rather than using the default server URL. ->
<URL> http://downloads.planetmirror.com/pub/maven2 </ URL>

<-! Mirrored server id. For example, if we want to set up a central Maven repository (http://repo1.maven.org/maven2) mirror image ->
<! - you need to set the element to be central. This must be exactly the same id central central warehouse. ->
<mirrorOf> Central </ mirrorOf>

</ Mirror>

</ Mirrors>

<! - to adjust the configuration to build a list based on environmental parameters. settings.xml profile element is cut version of the pom.xml profile element. ->
<-! It contains id, activation, repositories, pluginRepositories and properties of elements. ->
<! - here the profile element contains only five sub-elements are concerned here only because this whole building (which is the Role of settings.xml file) systems, rather than individual project object model settings. ->
<! - the settings if a profile is activated, its value will override any other definition POM profile or with the same id in the profile.xml. ->
<Profiles>

<-! The environment parameter adjusting member is disposed ->
<Profile>

<-! Unique identifier of the configuration. ->
<ID> Test </ ID>

<-! Profile automatically trigger logic conditions. Activation is the key to the profile. ->
<! - as POM in the same profile, the power profile automatically from its use certain value in certain circumstances; these environments specified by the activation element. ->
<! - activation elements are not the only way to activate the profile. activeProfile elements in settings.xml file can contain the id profile. ->
<-! Profile may be on the command line, using -P and comma-separated list of tags to explicitly activate (e.g., -P test). ->
<Activation>

<!
<activeByDefault> false </ activeByDefault>

<-! Activation has a built-in version detection java, jdk version if it detects as expected, profile is activated. ->
<JDK> 1.7 </ JDK>

<-! Operating system when the matching attribute is detected, profile is activated. os element can define attributes associated with the operating system. ->
<os>

<-! Operating system activation profile name ->
<name> Windows XP </ name>

<-! Operating system belongs to the family of the activation profile (such as 'Windows') ->
< Family> Windows </ Family>

<-! operating system architecture of the activation profile ->
<Arch> x86 </ Arch>

<-! activation profile of the operating system version ->
<version> 5.1.2600 </ Version>

</ OS>

<-! Maven is detected if one of the properties (which value can be referenced by $ {TITLE} in the POM), which has the corresponding name and value, Profile <br> is activated. ->
<! - If the value of the field is empty, then there is the attribute name field will activate the profile, or case-insensitive manner by matching attribute value field ->
<




<! - the value of the attribute activation profile ->
<value> 2.0.3 </ value>

</ Property>

<! - the name of a file to activate the profile by detecting the presence or absence of the document. check whether the missing file exists, if it does not exist activate profile. ->
<! - on the other hand, exists will check whether a file exists, if there is activated profile. ->
<File>

<-! If the specified file exists, the activation profile. ->
<EXISTS> / usr / local / hudson / hudson-Home / Jobs / Maven-Guide-zh-to-Production's / Workspace / </ EXISTS>

<-! If the specified file does not exist, then activate the profile. ->
<Missing> / usr / local / Hudson / Hudson-Home / Jobs / Maven-Guide-ZH-to-Production / Workspace / </ Missing>

</ File>

</ Activation>

<-! Corresponding to the profile list of extended attributes. Ant Maven properties and attributes like can be used to store a number of values. These values may be used anywhere in the POM numerals used $ {X}, where X is the name of the attribute. ->
<! - There are five different forms of property, and can be accessed in the settings.xml file. ->
<- 1 env.X:!. Before a variable plus ". Env" prefix, returns a shell environment variable. For example, "env.PATH" refers to the $ path environment variable (on Windows% PATH%). ->
<- 2 project.x:!. POM refer to the corresponding element values. ->
<-. 3 settings.x:!. Settings.xml values refer to the corresponding elements. ->
<-. 4 the Java the System the Properties:!. All () can be used to access properties in the POM by java.lang.System.getProperties access this form, ->
<- such as / usr / lib! /jvm/java-1.6.0-openjdk-1.6.0.0/jre. ->
<-!.. 5 X: in <properties /> element, an external file or set, used in the form of $ {someVar}. ->
<Properties>

<-! If this profile is activated, the attribute $ {user.install} can be accessed ->
<user.install> usr / local / Winner / Jobs / Maven-Guide </ user.install>

</ Properties>

<-! remote repository list, which is used to fill Maven project to build a set of remote local repository system used. ->
<Repositories>

<!



<the above mentioned id> codehausSnapshots </ the above mentioned id>

<-! remote repository name ->
<name> Codehaus Snapshots </ name>

<-! how to handle remote warehouse release download version ->
<Releases>

<! - true or false indicating whether the warehouse for downloading some type of components (release, snapshots) open. ->
<Enabled> to false </ Enabled>

<-! This element specifies the update frequency occurs. Maven POM would be more local and remote timestamp of POM. The options here are: ->
! <- Always (has been), daily (default, daily), interval: X (where X is the time interval in minutes), or never (never). ->
<updatePolicy> Always </ updatePolicy>

<- When Maven file failed checksum verification members how to do it:! ->
! <- the ignore (ignore), fail (failure) or warn (warning) . ->
<checksumPolicy> The warn </ checksumPolicy>

</ Releases>

<-! How to handle remote warehouse snapshot version of the download. With these two sets of releases and snapshots configuration, POM can be in each individual warehouse, adopt a different strategy for each type of component. ->
<! - For example, some people may decide to only open support for the snapshot version to download for development purposes.
See repositories / repository / releases the element -> <snapshots>

<Enabled />
<updatePolicy />
<checksumPolicy />

</ snapshots>

<- remote repository URL, according to protocol:! // hostname / path form ->
<url> http://snapshots.maven.codehaus.org / Maven2 </ URL>

<-! warehouse layout type for positioning and sorting member - may be default (default) or legacy (legacy). ->
! <- Maven 2 for warehouse provides a default layout; however, Maven 1.x had a different layout. We can use this element to specify the layout is the default (default) or legacy (legacy). ->
<layout> default </ layout>

</ Repository>

</ Repositories>

<-! Discover a remote repository list of plug-ins. Warehouse are the two main components of the home. The first dependent member is used as the other members. This is the most central component type warehouse stored. Another type plug member. ->
<-! Maven is a special type of plug member. For this reason, the plug-warehouse independently of the other warehouse. structure similar elements and repositories pluginRepositories element. ->
<-! PluginRepository each element specifies a Maven plug-ins can be used to find new remote addresses. ->
<

<! - contains information needed to connect to a remote repository plug-see profiles / profile / repositories / repository elements description -.>
<PluginRepository>
<Releases>
<Enabled />
<updatePolicy />
<checksumPolicy />
</ Releases>

<snapshots>
<Enabled />
<updatePolicy />
<checksumPolicy />
</ snapshots>

<ID />
<name />
<URL />
<layout />
</ pluginRepository>

</ pluginRepositories>

<-! manual activation profiles list profile is applied in the order defined activeProfile. The element contains a set activeProfile elements, each activeProfile contains a profile id. ->
<! - any profile id defined in the activeProfile, regardless of the environment setting, the corresponding profile will be activated. ->
<! - If no matching profile, then nothing will happen. For example, env-test is a activeProfile, corresponding to the id of the pom.xml profile is activated (or the profile.xml) in. ->
<! - If you can not find such a process is running profile, Maven will run as usual. ->
<activeProfiles>

<activeProfile> the env-Test </ activeProfile>

</ activeProfiles>

</ Profile>

</ Profiles>

</ Settings>

Guess you like

Origin www.cnblogs.com/lywleven/p/11809372.html