'management.endpoints.web.exposure.include'是未知属性

问题描述

我正在尝试首次实现Spring Actuator,当我尝试在 application.properties 中启用所有端点时,它会显示'management.endpoints.web.exposure。包括”是未知属性。对该请求的响应是:

{
    "timestamp": "2020-08-26T06:07:47.120Z","status": 404,"error": "Not Found","message": "No message available","path": "/actuator/health"
}

除此以外,我还包括

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

在pom.xml中,仅此而已。我有什么想念吗?

解决方法

您是否还将spring web添加为依赖项?

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>