首页 > 其他分享 >found character ‘@‘ that cannot start any token. 解决方案

found character ‘@‘ that cannot start any token. 解决方案

时间:2022-08-18 20:12:11浏览次数:74  
标签:spring character profiles start token active any

spring:
profiles:
active: @spring.profiles.active@
1
2
3
用 pom.xml 配合 yaml 文件实现动态配置。

项目使用了如上配置,一开始可以运行。但是在某次运行时突然开始报错。

Exception in thread "main" while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 3, column 13:
name: @spring.profiles.active@
1
2
3
4
解决方案是先检查是否在 maven 构建时选择了相应的配置。如果不能解决问题,则在 @@ 两侧加上单引号 ' 或双引号 " 。

spring:
profiles:
active: '@spring.profiles.active@'
————————————————
版权声明:本文为CSDN博主「ahy231」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ahy231/article/details/119141951

标签:spring,character,profiles,start,token,active,any
From: https://www.cnblogs.com/lxl57610/p/16599947.html

相关文章