Maven的pom.xml檔案詳解④Environment Settings
Issue Management
使用的缺陷跟蹤系統(Bugzilla
,TestTrack
,ClearQuest
,等)資訊,主要用於產生專案文件。
- <issueManagement>
- <system>Bugzilla</system>
- <url>http://127.0.0.1/bugzilla/</url>
- </issueManagement>
Continuous Integration Management
持續構建系統配置。
- <ciManagement>
- <system>continuum</system>
- <url>http://127.0.0.1:8080/continuum</url>
- <notifiers>
- <notifier>
- <type>mail</type>
- <sendOnError>true</sendOnError>
- <sendOnFailure>true</sendOnFailure>
- <sendOnSuccess>false</sendOnSuccess>
- <sendOnWarning>false</sendOnWarning>
- <configuration><address>
- </notifier>
- </notifiers>
- </ciManagement>
notifiers:定義當出現構建狀態時需要通知的人,已經通知的方式。
Mailing Lists
定義了該專案需要保持聯絡的人員,主要是開發人員和使用者的郵件列表。
- <mailingLists>
- <mailingList>
- <name>User List</name>
- <subscribe>[email protected]
- <unsubscribe>[email protected]</unsubscribe>
- <post>[email protected]</post>
- <archive>http://127.0.0.1/user/</archive>
- <otherArchives>
- <otherArchive>http://base.google.com/base/1/127.0.0.1</otherArchive>
- </otherArchives>
- </mailingList>
- </mailingLists>
subscribe、unsubscribe
:執行對應行為指定的郵件地址。如為了訂閱上面使用者的,一個使用者需要傳送email到[email protected];archive
:已歸檔的郵件列表郵件的url,如果有映象歸檔地址,則指定到otherArchives中;post
:post到郵件列表的郵件地址。
SCM
SCM:Software Configuration Management,也稱作Source Code/Control Management簡潔的成為version
control。
這裡是你存放版本管理資訊到POM的地方。
- <scm>
- <connection>scm:svn:http://127.0.0.1/svn/my-project</connection>
- <developerConnection>scm:svn:https://127.0.0.1/svn/my-project</developerConnection>
- <tag>HEAD</tag>
- <url>http://127.0.0.1/websvn/my-project</url>
- </scm>
connection
:要求對原始碼有讀的許可權,可以更新;developerConnection:要求對原始碼有寫的許可權,可以提交程式碼;Maven有另一個專案Maven SCM,提供公共的API,供SCM的外掛實現。目前所有的SCM的外掛可以在http://maven.apache.org/scm/scms-overview.html上找到;tag
:指定該專案所在的標籤。HEAD是預設;url
:一個公共的可瀏覽的倉庫。
Prerequisites
為了讓該POM正確的執行所需要的先決條件,這裡是你定義先決條件的地方。如果不滿足這些先決條件,Maven將不會開始。目前只有maven的最小版本號一個先決條件。
- <prerequisites>
- <maven>2.0.6</maven>
- </prerequisites>
Repositories
- <repositories>
- <repository>
- <releases>
- <enabled>false</enabled>
- <updatePolicy>always</updatePolicy>
- <checksumPolicy>warn</checksumPolicy>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </snapshots>
- <id>codehausSnapshots</id>
- <name>Codehaus Snapshots</name>
- <url>http://snapshots.maven.codehaus.org/maven2</url>
- <layout>default</layout>
- </repository>
- </repositories>
- <pluginRepositories>
- ...
- </pluginRepositories>
downloadUrl
:另一個POM配置用於獲取該POM的元件的倉庫的url;status
:這個值不能手動配置,當該元件上傳到倉庫時,Maven將設定這個專案的狀態,它的有效值為: none:沒有特殊狀態,預設;converted
:倉庫的管理人員從一個對Maven 2來說更早的版本轉換到這個POM;partner
:這個元件有被同步到一個合作倉庫;deployed
:最通用的狀態,這個元件從Maven2或者Maven2部署;verified
:這個專案被查證了,應該被終止。
Distribution Management
管理build生成的元件和資原始檔和分發。基本屬性
- <distributionManagement>
- ...
- <downloadUrl>http://mojo.codehaus.org/my-project</downloadUrl>
- <status>deployed</status>
- </distributionManagement>
downloadUrl
:另一個POM配置用於獲取該POM的元件的倉庫的url;status
:這個值不能手動配置,當該元件上傳到倉庫時,Maven將設定這個專案的狀態,它的有效值為: none:沒有特殊狀態,預設;converted
:倉庫的管理人員從一個對Maven 2來說更早的版本轉換到這個POM;partner
:這個元件有被同步到一個合作倉庫;deployed
:最通用的狀態,這個元件從Maven2或者Maven2部署;verified
:這個專案被查證了,應該被終止。
Repository
distributionManagement
通過repository定義當元件部署時,專案可以從哪裡(和怎麼)獲取遠端倉庫
- <distributionManagement>
- <repository>
- <uniqueVersion>false</uniqueVersion>
- <id>corp1</id>
- <name>Corporate Repository</name>
- <url>scp://repo/maven2</url>
- <layout>default</layout>
- </repository>
- <snapshotRepository>
- <uniqueVersion>true</uniqueVersion>
- <id>propSnap</id>
- <name>Propellors Snapshots</name>
- <url>sftp://propellers.net/maven</url>
- <layout>legacy</layout>
- </snapshotRepository>
- ...
- </distributionManagement>
id
:倉庫的唯一標識;name
:人類可讀的名稱;uniqueVersion
:true/false
,表示部署到該倉庫的元件是否應該獲取一個唯一產生的版本號,並用這個版本號作為地址的一部分;url
:指定用於傳送構建成的元件(包括POM檔案和校驗和資料)到倉庫的網路地址和傳輸協議,是Repository的核心;layout
:default/legacy
,同project下的repository 元素。
Site Distribution
比起分發到倉庫,distributionManagement
更多的運用是定義怎麼部署專案的站點和文件。
- <distributionManagement>
- ...
- <site>
- <id>mojo.website</id>
- <name>Mojo Website</name>
- <url>scp://beaver.codehaus.org/home/projects/mojo/public_html/</url>
- </site>
- ...
- </distributionManagement>
Relocation
- <distributionManagement>
- ...
- <relocation>
- <groupId>org.apache</groupId>
- <artifactId>my-project</artifactId>
- <version>1.0</version>
- <message>We have moved the Project under Apache</message>
- </relocation>
- ...
- </distributionManagement>
專案在發展的過程中,可能被迫轉移到其它更適合的地方。relocation
用於給專案的使用者指名該專案被重新命名為什麼(例如上面,專案被重新命名到org.apache:my-project:1.0),除此之外,它還提供一個專案轉移的解釋。
Profiles
POM 4.0的一個新特徵是改變專案被構建的環境的settings的能力。
- <profiles>
- <profile>
- <id>test</id>
- <activation>...</activation>
- <build>...</build>
- <modules>...</modules>
- <repositories>...</repositories>
- <pluginRepositories>...</pluginRepositories>
- <dependencies>...</dependencies>
- <reporting>...</reporting>
- <dependencyManagement>...</dependencyManagement>
- <distributionManagement>...</distributionManagement>
- </profile>
- </profiles>
Activation
Activation是profile的關鍵。一個profile的威力來自於在當前的環境下修改基本POM的能力。
- <profiles>
- <profile>
- <id>test</id>
- <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>
- <property>
- <name>sparrow-type</name>
- <value>African</value>
- </property>
- <file>
- <exists>${basedir}/file2.properties</exists>
- <missing>${basedir}/file1.properties</missing>
- </file>
- </activation>
- ...
- </profile>
- </profiles>
jdk
:如果jdk版本號匹配被給的字首,則profile被啟用,例如:1.5.0_06將匹配上面的配置;os
:在哪些作業系統下profile被啟用;property
:profile將啟用,如果Maven探測到一個對應的name=value
對的property
。file
:一個通過file的existence指定的檔名可以啟用profile。
相關推薦
Maven的pom.xml檔案詳解④Environment Settings
Issue Management 使用的缺陷跟蹤系統(Bugzilla,TestTrack,ClearQuest,等)資訊,主要用於產生專案文件。 <issueManagement>
Settings.xml檔案詳解
概要 settings.xml有什麼用? settings.xml檔案位置 配置優先順序 頂級元素概覽 LocalRepository InteractiveMode UsePluginRegistry Offline PluginGroups
Spring MVC 配置檔案dispatcher-servlet.xml 檔案詳解
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframew
maven核心:pom.xml檔案詳解
什麼是pom? pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。 快
3.pom.xml檔案詳解(慕課網)
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
Tomcat:server.xml檔案詳解
一、server.xml檔案介紹 1.server.xml作用 Server.xml配置檔案用於對整個容器進行相關的配置。 2.server.xml檔案的配置元素列表 <Server>:是整個配置檔案的根元素。表示整個Catalina容器。
Maven pom.xml檔案詳解
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.a
史上最全的maven的pom.xml檔案詳解
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://m
axis2系列之services.xml檔案詳解
原文連結(http://beyond-gzz.blog.163.com/blog/static/744735620119935948592/ )在Axis1中部署服務時,我們使用service.wsdd檔案來配置服務。在Axis2中,不再使用service.wsdd
SqlMapConfig.xml檔案詳解
SqlMapConfig.xml 是 mybatis 的全域性配置檔案,配置內容如下: properties(屬性) settings(全域性配置引數) typeAliases(類型別名) typeHandlers(型別處理器) objectFactory(物件工廠) plugins(外掛) e
Maven的pom.xml檔案詳解
快速預覽 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
AndroidManifest.xml檔案詳解(二)
檔案約定 某些約定和規則普遍適用於清單中的所有元素和屬性: 元素 只用<manifest>和<application>元素時必須的,而且這兩個元素在檔案中只能出現一次。其他元素則可以多次出現在清單中,或者根本就不出現---但是為了構建一個有意義的清單
MyBatis Mapper XML檔案詳解
MyBatis 的真正強大在於它的對映語句,也是它的魔力所在。由於它的異常強大,對映器的 XML 檔案就顯得相對簡單。如果拿它跟具有相同功能的 JDBC 程式碼進行對比,你會立即發現省掉了將近 95% 的程式碼。MyBatis 就是針對 SQL 構建的,並且比普通的方法做
最全的maven的pom.xml檔案詳解
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="h
Spring MVC 配置檔案 web.xml檔案詳解
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http
javaweb web.xml檔案詳解
<!-- 基本配置 --> <servlet> <servlet-name>snoop</servlet-name> <servlet-class>SnoopServlet</servlet-class> </ser
AndroidManifest.xml檔案詳解(uses-sdk)(轉載)
語法(SYNTAX): <uses-sdkandroid:minSdkVersion="integer"android:targetSdkVersion="integer"android:maxSdkVersion="integer"/> 被包含於(C
XML檔案詳解以及解析
例子: 注:xml宣告一般是xml文件的第一行;xml宣告由以下幾個部分組成: 4、根元素 它是xml文件裡面唯一的;它的開始是放在最前面,結束是放在最後面。 5、元素: (1) 所有的xml元素都必須有結束標籤; (2) xml標籤對大小寫敏感; (3) xml必須
web.xml檔案詳解
轉載地址:https://www.cnblogs.com/LiZhiW/p/4313844.html 一、web.xml檔案介紹 1.web.xml檔案的作用 web.xml主要用來配置Filter、Listener、Servlet等。但是要說明的是web.xm
【SpringMVC+mybatis】7.mybatis SqlMapConfig.xml檔案詳解
mybatis的全域性配置檔案SqlMapConfig.xml主要配置內容有:properties(屬性),settings(全域性配置引數),typeAliases(類型別名),typeHandlers(型別處理器),objectFactory(物件工廠),plugins