执行器不起作用

时间:2016-05-12 09:11:42

标签: spring rest spring-boot spring-boot-actuator

我正在尝试在我的spring启动应用程序中设置执行器端点,但我无法获取我在application.yml中设置的值。这是我到目前为止的配置:

src/main/resources/application.yml

info.app:
  description: mydescription
  name: myname
  version: 1.0

management.contextPath: /rest/internal/application

但是,当我尝试访问端点时,我只能得到这个:

rest call to http://localhost:8090/rest/internal/application/info

{
    "Manifest-Version":"1.0",
    "Created-By":"1.6.0_18 (Sun Microsystems Inc.)"
}

那么,我可以做错什么?

1 个答案:

答案 0 :(得分:4)

.app后缀导致问题,将info部分更改为例如。

info:
  description: mydescription
  name: myname
  version: 1.0

The documentation声明:

  

您可以通过设置自定义信息端点公开的数据   info。* Spring属性。信息下的所有环境属性   密钥将自动暴露。

以下是yaml中的示例:

info:
  app:
    name: MyService
    description: My awesome service
    version: 1.0.0
相关问题