Spring boot在yml配置文件中使用@xxx@命名报错

时间:2025-04-05 07:16:02

springboot报错: while scanning for the next token found

在yml文件里面使用配置@xxx@

spring:
  profiles:
    active: @@
    group:
      "dev": devDB,devMVC
      "pro": proDB,proMVC

只需要在pom文件中加载以下依赖:

<dependency>
    <groupId></groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.30</version>
</dependency>

ps: 用aliyun 创建的spring boot项目仍然会报错...

参考文章链接:

springboot报错: while scanning for the next token found ... - 简书springboot报错: while scanning for the next to.../p/bb8ac8abddc3?tdsourcetag=s_pctim_aiomsg