maven多环境配置如下:
druid druid true prod prod
application.yml使用如下:
spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: @activatedEnv@
报错如下:
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 19, column 13: active: @activatedEnv@
注意:
方法一:我刷新maven之后还是无法启动项目,报同样的错误,证明该方法不适用我的项目
方法二:在pom文件中新增过滤(亲测有效)
src/main/resources true