Maven pom.xml

通常的一個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來區分的.
它通常是工程的名稱 -->
  <artifactId>...</artifactId>
<!-- 版本號 -->
  <version>...</version>
<!-- packaged as a war or jar package,默認是jar -->
  <packaging>...</packaging>
<!--該元素描述了項目相關的所有依賴。
 這些依賴組成了項目構建過程中的一個個環節。
 它們自動從項目定義的倉庫中下載。-->
  <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>
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容