SpringBoot2.x中management.security.enabled=false无效怎么解决
作者:暮色微凉
时间:2023-05-12
来源:互联网
浏览:0
management.security.enabled=false无效一、在1.5.x版本中通过management.security.enabled=false来暴露所有端点具体配置类:org.springframework.boot.actuate.autoconfigure.ManagementServerProperties$Security二、切换SpringBoot版本为2.x使用IDE的搜索功能找到类ManagementServerProperties,发现Security内部类已经被删除三
management.security.enabled=false无效
一、在1.5.x版本中通过management.security.enabled=false来暴露所有端点

具体配置类:
org.springframework.boot.actuate.autoconfigure.ManagementServerProperties$Security
二、切换SpringBoot版本为2.x 使用IDE的搜索功能
找到类ManagementServerProperties,发现Security内部类已经被删除
三、去官网查看2.0暴露端点的方式
方式1:
# 启用端点 env management.endpoint.env.enabled=true # 暴露端点 env 配置多个,隔开 management.endpoints.web.exposure.include=env
方式2:
方式1中的暴露方式需要一个一个去开启需要暴露的端点,方式2直接开启和暴露所有端点
management.endpoints.web.exposure.include=*
注意在使用Http访问端点时,需要加上默认/actuator 前缀
management.security.enabled 过时
在Spring boot 2.0中
management.security.enabled=true
或
management: security: enabled:true
可以采用
management.endpoints.web.exposure.include=
代替的全部放开请使用*,或把需要开放的接口端点使用“,”隔开,如:env,health。
yaml 的配置*请加上“"”(引号)如下
management: endpoints: web: exposure: include: "*"
作者最新文章
白描 PDF
2026-09-16 17:44
密码键盘
2026-09-16 17:43
3dmax快捷键失效了怎么办
2026-09-16 13:53
Xiaomi 18 Fold首销数据解读:较上代大折叠增长310%的原因与配置分析
2026-09-08 16:55
PDF文件太大怎么压缩?在线减小体积的操作步骤
2026-09-03 11:12
热门文章
更多
精品专题
更多
Mac软件
更多
WINDOWS
更多
Windows 10
Windows
Windows 10 是一款微软推出的经典操作系统,拥有硬件兼容性与多任务处理能力。它更偏向把系统状态查看和常用调节动作放在一起,适合需要持续观察和微调设备状态的场景。
极度公式
Windows/macOS/Linux
极度公式是一款跨平台专业LaTeX公式识别编辑软件,支持OCR公式识别和多平台编辑。和使用说明,避免使用,享受完整功能与稳定支持。做扫描整理、文字提取和表格转换时,它能把识别后的处理步骤接得更顺,资料录入这类场景会省下不少时间。
















