[英]Commit timestamp in Maven version using jgitver
借助maven惰性评估,您可以使用版本插件将它们提供到构建中,例如:
mvn jgitver versions:set -DnewVersion=1.0.\${jgitver.head_commit_datetime} versions.commit
试试看,让我知道。
基本上,它将属性传递给versions:set插件,这会将所有pom文件重写为给定的新版本。
@ otto.poellath,可以使用配置属性useGitCommitTimestamp
并将其设置为true; 它仅在jgitver的non maven
模式下可用,因为它与严格的Maven SNAPSHOT有点冲突。
因此,如果您的.mvn/jgitver.config.xml
配置文件包含以下内容,则它将起作用:
<mavenLike>false</mavenLike>
<useGitCommitTimestamp>true</useGitCommitTimestamp>
这是使用这种配置在jgitver-maven-plugin本身上进行本地mvn validate
的输出
H:\jgitver-maven-plugin>mvn validate
[INFO] using jgitver configuration file: H:\jgitver-maven-plugin\.mvn\jgitver.config.xml
[INFO] Scanning for projects...
[INFO] Using jgitver-maven-plugin [1.3.0] (sha1: ef8eec9f820d662e63a84f1210c377183e450cbd)
[INFO] jgitver-maven-plugin is about to change project(s) version(s)
[INFO] fr.brouillard.oss::jgitver-maven-plugin::0 -> 1.3.1-20180710075533-integration
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jgitver Maven Plugin 1.3.1-20180710075533-integration
[INFO] ------------------------------------------------------------------------
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.