【问题标题】:"Cannot resolve configuration property" in Spring boot when trying to configure probes尝试配置探针时,Spring 引导中的“无法解析配置属性”
【发布时间】:2020-12-15 06:33:49
【问题描述】:
在我的Spring Boot 2.3.3.RELEASE 中,我很想启用readiness 和liveness 端点。
我将这个添加到 yml 文件中:
但 IntelliJ 用 "Cannot resolve configuration property" 标记这些值,并且端点不可访问(例如 http://localhost:8080/actuator/health/readiness)
【问题讨论】:
标签:
spring-boot
probe
readinessprobe
livenessprobe
【解决方案1】:
该项目缺少actuator 的琐碎依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
添加后,IntelliJ 停止抱怨,并且可以访问端点。