【发布时间】:2018-03-14 22:22:09
【问题描述】:
我在我的 spring boot application.yml 中配置了以下属性
info:
app:
name: @project.artifactId@
description: @project.description@
version: @project.version@
timestamp: @timestamp@
添加Spring Boot Actuator依赖后,我可以访问/info端点并查看信息。
为了显示时间戳信息,我在maven项目的pom.xml中添加如下属性,如下所示,
<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
</properties>
时间戳以正确的格式显示,但不正确。我的意思是我在 IST 时区,值显示为, 时间戳:“2017-10-03T16:24:02Z”这是不正确的,可能它以 GMT 时间格式显示。但是,我想要 IST 格式。
有人可以帮我解决这个问题吗?
【问题讨论】:
-
已回答 here stackoverflow.com/questions/38983934/… 您不需要从 application.properties/yml 中检索它。spring 足够聪明,可以处理它。
标签: maven spring-boot spring-boot-actuator spring-boot-maven-plugin