通常的一個pom文件:
<!-- 工程的根標簽定铜。-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Notice that modelVersion contains 4.0.0.
That is currently the only supported POM version for both Maven 2 & 3,
and is always required. -->
<modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
<!-- 公司或者組織的唯一標志金砍,并且配置時生成的路徑也是由此生成,
如com.companyname.project-group凳枝,
maven會將該項目打成的jar包放本地路徑:/com/companyname/project-group -->
<groupId>...</groupId>
<!-- 項目的唯一ID哺哼,一個groupId下面可能多個項目,就是靠artifactId來區(qū)分的.
它通常是工程的名稱 -->
<artifactId>...</artifactId>
<!-- 版本號 -->
<version>...</version>
<!-- packaged as a war or jar package,默認是jar -->
<packaging>...</packaging>
<!--該元素描述了項目相關的所有依賴。
這些依賴組成了項目構建過程中的一個個環(huán)節(jié)反璃。
它們自動從項目定義的倉庫中下載。-->
<dependencies>...</dependencies>
<!-- 父類依賴 -->
<parent>...</parent>
<!-- 幫助管理項目依賴假夺,只聲明淮蜈,如果引入,則須在dependencies里聲明侄泽。
所有子項的版本依賴使用這里的聲明礁芦,如果子項單獨聲明版本,則使用子項的 -->
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<reporting>...</reporting>
<!-- More Project Information -->
<name>...</name>
<description>...</description>
<url>...</url>
<inceptionYear>...</inceptionYear>
<licenses>...</licenses>
<organization>...</organization>
<developers>...</developers>
<contributors>...</contributors>
<!-- Environment Settings -->
<issueManagement>...</issueManagement>
<ciManagement>...</ciManagement>
<mailingLists>...</mailingLists>
<scm>...</scm>
<prerequisites>...</prerequisites>
<repositories>...</repositories>
<pluginRepositories>...</pluginRepositories>
<distributionManagement>...</distributionManagement>
<profiles>...</profiles>
</project>