spring boot 启动报错:Reason: Canonical names should be kebab-case ('-' separated), lowercase

spring boot 1.x 切换 2.x 以后启动报如下错误:

***************************
APPLICATION FAILED TO START
***************************

Description:

Configuration property name 'sysConf' is not valid:

    Invalid characters: 'C'
    Bean: sysConf
    Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'sysConf' so that it conforms to the canonical names requirements.

从报错信息可以看出,spring boot 2.x 中对配置文件中名称的命名规范进行了强制约束,需要使用kebab格式,不能使用java中的驼峰式写法了,分隔符使用 ’-‘ 来分隔

#系统配置
sys-conf:
  session-alive-time: 1800 

修改以后启动成功

你可能感兴趣的:(spring boot 启动报错:Reason: Canonical names should be kebab-case ('-' separated), lowercase)