spring-boot - 尝试配置探针时,Spring 引导中的“无法解析配置属性”
问题描述
在我的Spring Boot 2.3.3.RELEASE
情况下,我很想启用 toreadiness
和liveness
端点。
我将此添加到 yml 文件中:
但是 IntelliJ 用 "Cannot resolve configuration property" 标记这些值,并且端点不可访问(例如 http://localhost:8080/actuator/health/readiness)
解决方案
该项目缺少以下微不足道的依赖关系actuator
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
添加后,IntelliJ 停止抱怨,并且可以访问端点。
推荐阅读
- java - 文件未使用 file.delete() 从存储中删除
- mysql - 从 MySQL 表中获取具有相同列但值略有不同的行
- jsp - JSP中下拉更改后显示价格值
- javascript - 重新声明参数变量不会引发任何错误 - JavaScript
- python - 基于另一个具有日期时间范围的 DataFrame 的新 true/false DataFrame
- scikit-learn - 不平衡类的分类报告支持值指示
- javascript - React Native实时更改配色方案问题android
- python - 将张量流概率分布作为双射器参数传递
- python - 可能使用递归 lambda 函数的 Pandas 数据框“应用”?
- bash - 匹配安装路径的正则表达式