yaml文件中@占位符的问题
问题:
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 6, column 16:
profile: @spring.profiles.active@
配置了多环境,但是却不识别@
解决方法:
开发工具为idea
选项 run-edit configurations-spring boot-configurations-before launch:build,Activate tool windows-±run Maven Goal-输入pakage,完成应用就可以了
第一步

第二步

第三步

第四步

第五步

第六步
点击完成
原因:应该是运行之前先用maven进行打包处理,这样,环境配置就可以先进行路径的替换,然后Spring在运行的时候就可以不处理占位符直接获取配置文件处理。
1129




被折叠的 条评论
为什么被折叠?



