如何覆盖来自spring-boot-starter-parent 的git-commit-id-plugin的默认值,将以下内容放入build/plugins似乎并不能解决问题:
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<abbrevLength>10</abbrevLength>
</configuration>
</plugin>
在生成的git.properties中仍然看到默认的短版本:
git.commit.id.describe-short=05780bf
git.commit.id.describe=05780bf
更新:
根据下面@kan的建议,我尝试了以下方法:
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<abbrevLength>10</abbrevLength>
<gitDescribe>
<abbrev>10</abbrev>
</gitDescribe>
</configuration>
</plugin>
它在git.properties中产生了以下内容:
git.commit.id.abbrev=8b8a2f7
git.commit.id.describe-short=8b8a2f727c
git.commit.id.describe=8b8a2f727c
但是,Spring Boot 应用程序的/info端点仍然显示缩短的版本,显然来自git.commit.id.abbrev:
{
"application":
{
"name": "broker-feed"
},
"build":
{
"version": "0.0.1-SNAPSHOT"
},
"git":
{
"branch": "master",
"commit":
{
"id": "8b8a2f7",
"time": "2015-08-28T13:00:49-0400"
}
}
}
是否可以将 Spring Boot 插件重定向以选择另一个版本,或者我在此过程中是否遗漏了其他东西?
谢谢!