【发布时间】:2015-08-28 16:15:52
【问题描述】:
如何覆盖 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 插件重定向到选择另一个版本,或者我是否在此过程中遗漏了其他内容?
谢谢!
【问题讨论】:
标签: git maven spring-boot spring-boot-actuator