settings.xml
对maven中setting.xml配置文件进行解释
1.声明规范
1 2 3
| <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">
|
2.localRepository
1 2
| <localRepository>/opt/repository</localRepository>
|
3.interactiveMode
1 2 3 4
|
<interactiveMode>true</interactiveMode>
|
4.usePluginRegistry
1 2 3
|
<usePluginRegistry>false</usePluginRegistry>
|
5.offline
1 2 3 4 5
|
<usePluginRegistry>false</usePluginRegistry>
|
6.pluginGroups
1 2 3 4 5 6 7 8
|
<pluginGroups> <pluginGroup>org.codehaus.mojo</pluginGroup> </pluginGroups>
|
7.proxies
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <proxies> <proxy> <id>myproxy</id> <active>true</active> <protocol>http</protocol> <host>proxy.somewhere.com</host> <port>8080</port> <username>proxyuser</username> <password>somepassword</password> <nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts> </proxy> </proxies>
|
8.servers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <servers> <server> <id>server001</id> <username>my_login</username> <password>my_password</password> {user.home} <privateKey>${usr.home}/.ssh/id_dsa</privateKey> <passphrase>some_passphrase</passphrase> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> </server> </servers>
|
9.mirrors
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <mirrors> <mirror> <id>planetmirror.com</id> <name>PlanetMirror Australia</name> <url>http://downloads.planetmirror.com/pub/maven2</url>
<mirrorOf>central</mirrorOf> </mirror> </mirrors>
|
10.profile
1 2 3 4 5 6 7 8 9 10 11 12
|
<profiles> <profile> <id>test</id>
|
11.activation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <activation> <activeByDefault>false</activeByDefault> <jdk>1.5</jdk> <os> <name>Windows XP</name> <family>Windows</family> <arch>x86</arch> <version>5.1.2600</version> </os> {name} <property> <name>mavenVersion</name> <value>2.0.3</value> </property> <file> <exists>${basedir}/file2.properties</exists> <missing>${basedir}/file1.properties</missing> </file> </activation>
|
12.Repositories
远程仓库列表,它是Maven用来填充构建系统本地仓库所使用的一组远程项目。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <repositories> <repository> <id>codehausSnapshots</id> <name>Codehaus Snapshots</name> <url>http://snapshots.maven.codehaus.org/maven2</url> <layout>default</layout> <releases> <enabled>false</enabled>
<updatePolicy>always</updatePolicy> <checksumPolicy>warn</checksumPolicy> </releases> <snapshots> <enabled/> <updatePolicy/> <checksumPolicy/> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id/> <name/> <url/> <layout/> <releases> <enabled/> <updatePolicy/> <checksumPolicy/> </releases> <snapshots> <enabled/> <updatePolicy/> <checksumPolicy/> </snapshots> </pluginRepository> </pluginRepositories>
|
13.activeProfiles
配置解释:
手动激活profiles的列表,按照profile被应用的顺序定义activeProfile。 该元素包含了一组activeProfile元素,每个activeProfile都含有一个profile id。任何在activeProfile中定义的profile id,不论环境设置如何,其对应的profile都会被激活。如果没有匹配的profile,则什么都不会发生。例如,alwaysActiveProfile是一个activeProfile,则在pom.xml(或者profile.xml)中对应id的profile会被激活。如果运行过程中找不到这样一个profile,Maven则会像往常一样运行
1 2 3 4
| <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles>
|