如何定制Maven独特的版本字符串? [英] How can the Maven unique version string be customized?

查看:477
本文介绍了如何定制Maven独特的版本字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道当
< uniqueVersion> true< / uniqueVersion> 时,自定义用于Maven工件部署的时间戳字符串的选项组。理想情况下,我们希望包含来自源代码控制的changelist号码,而不是时间戳,因为这是一种更可靠的手段来确定给定构建中的功能和错误修复。

I'd like to know what options exist to customize the timestamp string used in Maven artifact deploys when <uniqueVersion>true</uniqueVersion> is set. Ideally, we'd like to include the changelist number from source control instead of a timestamp as it's a more dependable means of determining what features and bug fixes are in a given build.

推荐答案


我想知道当设置为true时,存在哪些选项来定制Maven工件部署中使用的时间戳字符串。

I'd like to know what options exist to customize the timestamp string used in Maven artifact deploys when true is set.

您不能自定义它,时间戳字符串是一个定义良好的内部事物, (如果您在 distributionManagement 元素中将 uniqueVersion 设置为 false )。

You can't customize it, the timestamped string is a well defined internal thing that is supposed to be used as is, or not (if you set uniqueVersion to false in the distributionManagement element).

从Maven的书(对读者感兴趣,它不会真正帮助你):

From the Maven book (for readers interested, it won't really help you):


3.3.1.2。 SNAPSHOT版本



Maven版本可以包含字符串
,表示当前正在开发的项目是
。如果
a版本包含字符串
SNAPSHOT,则Maven会将
此令牌扩展为日期和时间值
转换为UTC(协调
通用时间)您安装或
发布此组件。例如,
如果你的项目有一个版本的
1.0-SNAPSHOT,你将这个
项目的工件部署到一个Maven
仓库,Maven会扩展这个
版本到1.0-20080207-230803-1如果
你要部署一个版本在11:08
PM在2008年2月7日UTC。在其他
字中,当您部署快照时,
不会发布软件
组件;您将在特定的
时间发布组件的
快照。

3.3.1.2. SNAPSHOT Versions

Maven versions can contain a string literal to signify that a project is currently under active development. If a version contains the string "SNAPSHOT," then Maven will expand this token to a date and time value converted to UTC (Coordinated Universal Time) when you install or release this component. For example, if your project has a version of "1.0-SNAPSHOT" and you deploy this project’s artifacts to a Maven repository, Maven would expand this version to "1.0-20080207-230803-1" if you were to deploy a release at 11:08 PM on February 7th, 2008 UTC. In other words, when you deploy a snapshot, you are not making a release of a software component; you are releasing a snapshot of a component at a specific time.

这篇关于如何定制Maven独特的版本字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆