1. 程式人生 > >02.基於IDEA+Spring+Maven搭建測試項目--Maven的配置文件settings.xml

02.基於IDEA+Spring+Maven搭建測試項目--Maven的配置文件settings.xml

oca true ror 匹配 content com 一個 1.0 遠程

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <settings xmlns="http://maven.apache.org/SETTINGS/4.0.0" 
 3           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 4           xsi:schemaLocation="http://maven.apache.org/SETTINGS/4.0.0 http://maven.apache.org/xsd/settings-4.0.0.xsd">
 5   <!--本地倉庫。該值表示構建系統本地倉庫的路徑。其默認值為%USER_HOME%/.m2/repository。
--> 6 <localRepository>F:\Java\Maven\repository</localRepository> 7 8 <!--表示Maven是否需要在離線模式下運行。如果構建系統需要在離線模式下運行,則為true,默認為false。當由於網絡設置原因或者安全因素,構建服務器不能連接遠程倉庫的時候,該配置就十分有用。 --> 9 <offline>false</offline> 10 11 <!-- 遠程服務器部署地址配置,筆者公司信息,敏感原因去掉password -->
12 <servers> 13 <server> 14 <id>public</id> 15 <username>developer</username> 16 <password></password> 17 </server> 18 <server> 19 <id>releases</id> 20 <username>developer</username
> 21 <password></password> 22 </server> 23 <server> 24 <id>snapshots</id> 25 <username>developer</username> 26 <password></password> 27 </server> 28 </servers> 29 30 <!--設置包下載路徑。--> 31 <!--定義公共倉庫,除此之外,可能還會配置公司倉庫地址--> 32 <mirrors> 33 <!-- 阿裏雲倉庫 --> 34 <mirror> 35 <id>nexus-aliyun</id> 36 <mirrorOf>central</mirrorOf> 37 <name>Nexus aliyun</name> 38 <url>http://maven.aliyun.com/nexus/content/groups/public/</url> 39 </mirror> 40 <!-- 中央雲倉庫 --> 41 <mirror> 42 <id>repo</id> 43 <mirrorOf>central</mirrorOf> 44 <name>Human Readable Name for this Mirror.</name> 45 <url>http://repo1.maven.org/maven2/</url> 46 </mirror> 47 48 </mirrors> 49 50 <!--根據環境參數來調整構建配置的列表,筆者公司信息,過濾掉參數。--> 51 <!--settings.xml中的profile元素是pom.xml中profile元素的裁剪版本。--> 52 <!--它包含了id,activation, repositories, pluginRepositories和 properties元素。--> 53 <!--這裏的profile元素只包含這五個子元素是因為這裏只關心構建系統這個整體(這正是settings.xml文件的角色定位),而非單獨的項目對象模型設置。--> 54 <!--如果一個settings中的profile被激活,它的值會覆蓋任何其它定義在POM中或者profile.xml中的帶有相同id的profile。 --> 55 56 <profiles> 57 <profile> 58 <id>ht-dev</id> 59 <!--定義的公共倉庫。--> 60 <repositories> 61 <repository> 62 <id>public</id> 63 <url>http://localhost/nexus/content/groups/public/</url> 64 <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots> 65 </repository> 66 </repositories> 67 <pluginRepositories> 68 <pluginRepository> 69 <id>public</id> 70 <url>http://localhost/nexus/content/groups/public/</url> 71 <snapshots><enabled>true</enabled></snapshots> 72 </pluginRepository> 73 </pluginRepositories> 74 </profile> 75 </profiles> 76 77 <!--手動激活profiles的列表,按照profile被應用的順序定義activeProfile。 --> 78 <!--該元素包含了一組activeProfile元素,每個activeProfile都含有一個profile id。 --> 79 <!--任何在activeProfile中定義的profile id,不論環境設置如何,其對應的profile都會被激活。如果沒有匹配的profile,則什麽都不會發生。--> 80 <!--例如,env-test是一個activeProfile,則在pom.xml(或者profile.xml)中對應id的profile會被激活。如果運行過程中找不到這樣一個profile,Maven則會像往常一樣運行。 --> 81 <activeProfiles> 82 <activeProfile>ht-dev</activeProfile> 83 </activeProfiles> 84 </settings>

02.基於IDEA+Spring+Maven搭建測試項目--Maven的配置文件settings.xml