当前位置: 首页 > news >正文

Maven POM元素解析

这是对Maven中使用的Maven项目描述符的引用。

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"child.project.url.inherit.append.path=.. ><modelVersion/><parent><groupId/><artifactId/><version/><relativePath/></parent><groupId/><artifactId/><version/><packaging/><name/><description/><url/><inceptionYear/><organization><name/><url/></organization><licenses><license><name/><url/><distribution/><comments/></license></licenses><developers><developer><id/><name/><email/><url/><organization/><organizationUrl/><roles/><timezone/><properties><key>value</key></properties></developer></developers><contributors><contributor><name/><email/><url/><organization/><organizationUrl/><roles/><timezone/><properties><key>value</key></properties></contributor></contributors><mailingLists><mailingList><name/><subscribe/><unsubscribe/><post/><archive/><otherArchives/></mailingList></mailingLists><prerequisites><maven/></prerequisites><modules/><scm child.scm.connection.inherit.append.path=.. child.scm.developerConnection.inherit.append.path=.. child.scm.url.inherit.append.path=.. ><connection/><developerConnection/><tag/><url/></scm><issueManagement><system/><url/></issueManagement><ciManagement><system/><url/><notifiers><notifier><type/><sendOnError/><sendOnFailure/><sendOnSuccess/><sendOnWarning/><address/><configuration><key>value</key></configuration></notifier></notifiers></ciManagement><distributionManagement><repository><uniqueVersion/><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></repository><snapshotRepository><uniqueVersion/><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></snapshotRepository><site child.site.url.inherit.append.path=.. ><id/><name/><url/></site><downloadUrl/><relocation><groupId/><artifactId/><version/><message/></relocation><status/></distributionManagement><properties><key>value</key></properties><dependencyManagement><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies></dependencyManagement><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><repositories><repository><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></repository></repositories><pluginRepositories><pluginRepository><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></pluginRepository></pluginRepositories><build><sourceDirectory/><scriptSourceDirectory/><testSourceDirectory/><outputDirectory/><testOutputDirectory/><extensions><extension><groupId/><artifactId/><version/></extension></extensions><defaultGoal/><resources><resource><targetPath/><filtering/><directory/><includes/><excludes/></resource></resources><testResources><testResource><targetPath/><filtering/><directory/><includes/><excludes/></testResource></testResources><directory/><finalName/><filters/><pluginManagement><plugins><plugin><groupId/><artifactId/><version/><extensions/><executions><execution><id/><phase/><goals/><inherited/><configuration/></execution></executions><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><goals/><inherited/><configuration/></plugin></plugins></pluginManagement><plugins><plugin><groupId/><artifactId/><version/><extensions/><executions><execution><id/><phase/><goals/><inherited/><configuration/></execution></executions><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><goals/><inherited/><configuration/></plugin></plugins></build><reports/><reporting><excludeDefaults/><outputDirectory/><plugins><plugin><groupId/><artifactId/><version/><reportSets><reportSet><id/><reports/><inherited/><configuration/></reportSet></reportSets><inherited/><configuration/></plugin></plugins></reporting><profiles><profile><id/><activation><activeByDefault/><jdk/><os><name/><family/><arch/><version/></os><property><name/><value/></property><file><missing/><exists/></file></activation><build><defaultGoal/><resources><resource><targetPath/><filtering/><directory/><includes/><excludes/></resource></resources><testResources><testResource><targetPath/><filtering/><directory/><includes/><excludes/></testResource></testResources><directory/><finalName/><filters/><pluginManagement><plugins><plugin><groupId/><artifactId/><version/><extensions/><executions><execution><id/><phase/><goals/><inherited/><configuration/></execution></executions><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><goals/><inherited/><configuration/></plugin></plugins></pluginManagement><plugins><plugin><groupId/><artifactId/><version/><extensions/><executions><execution><id/><phase/><goals/><inherited/><configuration/></execution></executions><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><goals/><inherited/><configuration/></plugin></plugins></build><modules/><distributionManagement><repository><uniqueVersion/><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></repository><snapshotRepository><uniqueVersion/><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></snapshotRepository><site child.site.url.inherit.append.path=.. ><id/><name/><url/></site><downloadUrl/><relocation><groupId/><artifactId/><version/><message/></relocation><status/></distributionManagement><properties><key>value</key></properties><dependencyManagement><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies></dependencyManagement><dependencies><dependency><groupId/><artifactId/><version/><type/><classifier/><scope/><systemPath/><exclusions><exclusion><groupId/><artifactId/></exclusion></exclusions><optional/></dependency></dependencies><repositories><repository><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></repository></repositories><pluginRepositories><pluginRepository><releases><enabled/><updatePolicy/><checksumPolicy/></releases><snapshots><enabled/><updatePolicy/><checksumPolicy/></snapshots><id/><name/><url/><layout/></pluginRepository></pluginRepositories><reports/><reporting><excludeDefaults/><outputDirectory/><plugins><plugin><groupId/><artifactId/><version/><reportSets><reportSet><id/><reports/><inherited/><configuration/></reportSet></reportSets><inherited/><configuration/></plugin></plugins></reporting></profile></profiles>
</project>

project

<project>元素是描述符的根。下表列出了所有可能的子元素。

AttributeTypeDescription
child.project.url.inherit.append.pathString当子级继承项目的url时,是否追加路径?注意:虽然出于技术原因,该字段的类型为String,但语义类型实际上是Boolean
Default value istrue
Since: Maven 3.6.1
ElementTypeDescription
modelVersionString指定了当前Maven模型的版本号
ParentParent父项目的位置(如果存在)。如果未指定父项目中的值,则它们将是此项目的默认值。该位置以group ID, artifact ID and version的形式给出。
groupIdString项目的通用唯一标识符。通常使用完全限定的包名称来将其与具有类似名称的其他项目(例如org.apache.maven)区分开来。
artifactIdStringgroupId给定的组中是唯一的。artifact是由项目生产或使用的东西。Maven为项目生成的工件的示例包括:JAR、源代码和二进制发行版以及WAR。
versionString此项目生成的artifact的当前版本。
packagingString该项目产生的工件的类型,例如jar war ear pom。插件可以创建自己的打包,因此也可以创建它们自己的打包类型,因此该列表不包含所有可能的类型。

Default value isjar

.
nameString项目名称
descriptionString项目的详细描述,Maven在需要描述项目时使用,例如在网站上。虽然可以将该元素指定为CDATA以允许在描述中使用HTML标记,但不建议允许纯文本表示。如果需要修改生成的网站的索引页,则可以指定自己的索引页而不是调整此文本。
urlString项目主页的URL。
默认值为:父值[+路径调整]+(artifactId或project.directory属性),或者如果项目的子级为.project.url.inherit.append.path=“false”,则仅为父值
inceptionYearString项目开始的年份,用4位数字指定。此值在生成版权声明以及作为信息时使用。
OrganizationOrganization该元素描述项目所属组织的各种属性。创建文档时使用这些属性(用于版权声明和链接)。
licenses/license*List<License>(Many) 此元素描述此项目的所有许可证。每个许可都由许可元素描述,然后由其他元素描述。项目应仅列出应用于项目的许可证,而不是应用于依赖项的许可证。如果列出了多个许可证,则假设用户可以选择其中的任何一个,而不是必须全部接受。
developers/developer*List<Developer>(Many) 描述项目的提交者。
contributors/contributor*List<Contributor>(Many) 描述尚未提交的项目参与者。
mailingLists/mailingList*List<MailingList>(Many) Contains information about a project's mailing lists.
PrerequisitesPrerequisitesDescribes the prerequisites in the build environment for this project.
modules/module*List<String>(Many) 要作为此项目的一部分生成的模块(有时称为子项目)。列出的每个模块都是包含该模块的目录的相对路径。为了与从父级计算默认url的方式一致,建议模块名称与artifact ids匹配。
ScmScmSpecification for the SCM used by the project, such as CVS, Subversion, etc.
IssueManagementIssueManagementThe project's issue management system information.
CiManagementCiManagementThe project's continuous integration information.
DistributionManagementDistributionManagement支持将站点和工件分别部署到远程web服务器和存储库的项目的分发信息。
properties/key=value*Properties(Many) 可以在整个POM中用作替代的属性,并在启用时用作资源中的筛选器。格式为<name>value</name>。
DependencyManagementDependencyManagement从该项目继承的项目的默认依赖项信息。此部分中的依赖项不会立即解析。相反,当从该POM派生的POM声明由匹配的groupId和artifactId描述的依赖项时,如果尚未指定该部分中的版本和其他值,则将其用于该依赖项。
dependencies/Dependency*List<Dependency>(Many) 

该元素描述与项目关联的所有依赖项。这些依赖项用于在构建过程中为项目构建类路径。它们将从该项目中定义的存储库中自动下载。有关详细信息,请参阅依赖关系机制。

repositories/Repository*List<Repository>(Many) The lists of the remote repositories for discovering dependencies and extensions.
pluginRepositories/pluginRepository*List<Repository>(Many) The lists of the remote repositories for discovering plugins for builds and reports.
BuildBuildInformation required to build the project.
reportsDOMDeprecated. Now ignored by Maven.
reportingReporting该元素包括用于在Maven生成的站点上生成报告的报告插件的规范。这些报告将在用户执行mvn站点时运行。所有报告都将包含在导航栏中以供浏览。
profiles/profile*List<Profile>(Many) 激活时将修改生成过程的项目本地生成配置文件的列表。

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • Rust 实战练习 - 9. 文本编码,URL编码,加密解密
  • 汽车EDI:如何与奔驰建立EDI连接?
  • pta L-007 念数字
  • LeetCode热题Hot100 - 有效的括号
  • Golang | Leetcode Golang题解之第17题电话号码的字母组合
  • SQL SERVER 备份
  • jenv实现mac下多版本jdk管理以及切换
  • 【AcWing】蓝桥杯集训每日一题Day14|Flood Fill|洪水灌溉算法|DFS|并查集|687.扫雷(C++)
  • Python读取Excel根据每行信息生成一个PDF——并自定义添加文本,可用于制作准考证
  • 一篇文章了解php7和php8新特性
  • 鸿蒙南向开发:制作【智能儿童手表】
  • java实现API服务及请求客户端
  • Utilize webcam to capture photo with camera
  • Leetcode C语言习题
  • 头歌:共享单车之数据可视化
  • [分享]iOS开发 - 实现UITableView Plain SectionView和table不停留一起滑动
  • 【JavaScript】通过闭包创建具有私有属性的实例对象
  • AngularJS指令开发(1)——参数详解
  • flask接收请求并推入栈
  • iOS编译提示和导航提示
  • JavaScript新鲜事·第5期
  • java第三方包学习之lombok
  • Java多线程(4):使用线程池执行定时任务
  • JS函数式编程 数组部分风格 ES6版
  • js面向对象
  • MQ框架的比较
  • Rancher如何对接Ceph-RBD块存储
  • redis学习笔记(三):列表、集合、有序集合
  • Spring框架之我见(三)——IOC、AOP
  • SwizzleMethod 黑魔法
  • Webpack 4x 之路 ( 四 )
  • WebSocket使用
  • 闭包,sync使用细节
  • 初识 webpack
  • 第13期 DApp 榜单 :来,吃我这波安利
  • 对象引论
  • 复习Javascript专题(四):js中的深浅拷贝
  • 前端 CSS : 5# 纯 CSS 实现24小时超市
  • 使用parted解决大于2T的磁盘分区
  • 小程序测试方案初探
  • Oracle Portal 11g Diagnostics using Remote Diagnostic Agent (RDA) [ID 1059805.
  • 翻译 | The Principles of OOD 面向对象设计原则
  • (1)svelte 教程:hello world
  • (C11) 泛型表达式
  • (ibm)Java 语言的 XPath API
  • (java)关于Thread的挂起和恢复
  • (二)什么是Vite——Vite 和 Webpack 区别(冷启动)
  • (附源码)计算机毕业设计SSM保险客户管理系统
  • (力扣)1314.矩阵区域和
  • (论文阅读40-45)图像描述1
  • (十六)一篇文章学会Java的常用API
  • (转) Android中ViewStub组件使用
  • .MyFile@waifu.club.wis.mkp勒索病毒数据怎么处理|数据解密恢复
  • .NET 项目中发送电子邮件异步处理和错误机制的解决方案
  • .NET 中让 Task 支持带超时的异步等待