springboot2.0 management.security.enabled無效


在1.5.x版本中通過management.security.enabled=false來暴露所有端點

在使用springcloud的時候,如果基於springboot2的版本的配置中心,無法使用SVN的刷新功能(修改配置后不需要重啟服務器),那么需要重新按照新版本的要求進行配置

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

同時在控制層需要加上相應注解

@RefreshScope // 使用該注解的類,會在接到SpringCloud配置中心配置刷新的時候,自動將新的配置更新到該類對應的字段中。
然后用post請求去訪問http://localhost:8002/refresh


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM