直接上解决方法:

application.properties

# 2.6 以后默认为 false 隐藏 info 信息,需要开启
management.info.env.enabled=true

application.yml

management:
  info:
    env:
      enabled: true

重启就可以看到了

转自:关于Spring Actuator info为空或{}