美文网首页
Maven pom.xml

Maven pom.xml

作者: 柳源居士 | 来源:发表于2019-11-05 20:11 被阅读0次

通常的一个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>

相关文章

网友评论

      本文标题:Maven pom.xml

      本文链接:https://www.haomeiwen.com/subject/xmjjbctx.html