Spring Boot中我们一般使用yaml作为配置文件,yaml都是通过键值对的形式,一般情况下,我们的键值都是字母、数字之类的,但是偶尔的,我们可能使用到特殊字符。
比如,有时候我们设置actuator时,可以设置暴漏的网址,我们可能为了方便,就直接设置所有的网址,也就是设置*,但是如果直接设置,启动时会报错。
对于这种特殊字符,我们可以通过'将特殊字符包裹起来,如下
management:
  endpoint:
    beans:
      enabled: true
    health:
#      显示详细信息
      show-details: always
  endpoints:
    web:
      exposure:
        include: '*'      
    
          
          
          
          
评论 (0)