springboot2.0 management.security.enabled无效

在1.5.x版本中经过management.security.enabled=false来暴露全部端点web

在使用springcloud的时候,若是基于springboot2的版本的配置中心,没法使用SVN的刷新功能(修改配置后不须要重启服务器),那么须要从新按照新版本的要求进行配置spring

#yml格式
management:
 endpoints:
  web:
exposure: include: refresh
#properties文件格式
management.endpoints.web.exposure.include=*

同时在控制层须要加上相应注解springboot

@RefreshScope // 使用该注解的类,会在接到SpringCloud配置中心配置刷新的时候,自动将新的配置更新到该类对应的字段中。
而后用post请求去访问http://localhost:8002/refresh服务器

相关文章
相关标签/搜索