Maven POM元素解析(二)

发布于:2024-04-16 ⋅ 阅读:(20) ⋅ 点赞:(0)


一、parent

<parent>元素包含定位此项目将从中继承的父项目所需的信息。注意:此元素的子元素不是插值的,必须作为文字值给定。

Element Type Description
groupId String 要从中继承的父项目的组id。
artifactId String 要从中继承的父项目的项目id。
version String 要继承的父项目的版本。
relativePath String 签出中父pom.xml文件的相对路径。如果未指定,则默认为/pom.xml。Maven首先在文件系统上的这个位置查找父POM,然后在本地存储库中查找,最后在远程repo中查找。relativePath允许您选择不同的位置,例如,当您的结构是平的,或者更深而没有中间父POM时。但是,组ID、工件ID和版本仍然是必需的,并且必须与给定位置的文件匹配,否则它将恢复到POM的存储库。此功能仅用于增强该项目的本地签出中的开发。如果您想禁用该功能并始终从存储库中解析父POM,请将该值设置为空字符串。
默认值为:/pom.xml

.

二、organization

指定生成此项目的组织。

Element Type Description
name String 组织的全名。
url String 组织主页的URL。

 三、license

描述此项目的许可证。这用于生成项目网站的许可证页面,并在其他报告和验证中加以考虑。为项目列出的许可证是项目本身的许可证,而不是依赖项的许可证。

Element Type Description
name String The full legal name of the license.
url String The official url for the license text.
distribution String The primary method by which this project may be distributed.

repo

may be downloaded from the Maven repository

manual

user must manually download and install the dependency.

comments String Addendum information pertaining to this license.

四、developer 

有关此项目的一个开发者的信息。

Element Type Description
id String The unique ID of the developer in the SCM.
name String The full name of the contributor.
email String The email address of the contributor.
url String The URL for the homepage of the contributor.
organization String The organization to which the contributor belongs.
organizationUrl String The URL of the organization.
roles/role* List<String> (Many) The roles the contributor plays in the project. Each role is described by a role element, the body of which is a role name. This can also be used to describe the contribution.
timezone String The timezone the contributor is in. Typically, this is a number in the range -12 to +14 or a valid time zone id like "America/Montreal" (UTC-05:00) or "Europe/Paris" (UTC+01:00).
properties/key=value* Properties (Many) Properties about the contributor, such as an instant messenger handle.

五、contributor

对项目有贡献但没有提交权限的人员的描述。通常,这些贡献以提交的补丁的形式出现。

Element Type Description
name String The full name of the contributor.
email String The email address of the contributor.
url String The URL for the homepage of the contributor.
organization String The organization to which the contributor belongs.
organizationUrl String The URL of the organization.
roles/role* List<String> (Many) The roles the contributor plays in the project. Each role is described by a role element, the body of which is a role name. This can also be used to describe the contribution.
timezone String The timezone the contributor is in. Typically, this is a number in the range -12 to +14 or a valid time zone id like "America/Montreal" (UTC-05:00) or "Europe/Paris" (UTC+01:00).
properties/key=value* Properties (Many) Properties about the contributor, such as an instant messenger handle.