22:47:12.945 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '%' that cannot start any token. (Do not use % for indentation)
配置文件为yml错误提示,不能用%开头!
解决办法:
最佳解决,整个value用单引号包裹起来,次之:或者加上其他符号,比如短横线。
最无奈的办法,改用properties格式的配置文件,还是用yml吧...
第二个坑:配置的value不能为 * 也需要''单引号包裹起来
有配置取配置值,无值使用指定的值
有配置项CONFIG-GIT-USERNAM、CONFIG-GIT-PASSWORD,则去配置项的数据,没有则使用冒号后的指定值
username: ${CONFIG-GIT-USERNAME:username}
password: ${CONFIG-GIT-PASSWORD:password}