首页 > 解决方案 > 尝试配置探针时,Spring 引导中的“无法解析配置属性”

问题描述

在我的Spring Boot 2.3.3.RELEASE情况下,我很想启用 toreadinessliveness端点。

我将此添加到 yml 文件中:

在此处输入图像描述

但是 IntelliJ 用 "Cannot resolve configuration property" 标记这些值,并且端点不可访问(例如 http://localhost:8080/actuator/health/readiness)

标签: spring-bootprobereadinessprobelivenessprobe

解决方案


该项目缺少以下微不足道的依赖关系actuator

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

添加后,IntelliJ 停止抱怨,并且可以访问端点。


推荐阅读