found character '@' that cannot start any token. (Do not use @ for indentation)

原创
2022/04/18 10:35
阅读数 1.2W

如果没有出现profiles,那么是在pom中缺少以下配置

<profiles>
        <profile>
            <id>local</id>
            <properties>
                <!-- 环境标识,需要与配置文件的名称相对应 -->
                <profiles.active>local</profiles.active>
                <logging.level>debug</logging.level>
                <logging.org.springframework>warn</logging.org.springframework>
            </properties>
            <activation>
                <!-- 默认环境 -->
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>dev</id>
            <properties>
                <!-- 环境标识,需要与配置文件的名称相对应 -->
                <profiles.active>dev</profiles.active>
                <logging.level>debug</logging.level>
                <logging.org.springframework>warn</logging.org.springframework>
            </properties>
        </profile>
</profiles>

出现效果如下:

  • 如果加了之后出现以下异常,那么可以直接
found character '@' that cannot start any token. (Do not use @ for indentation)  in 'reader', line 3, column 13:         active: @profiles.active@

直接maven来更新update一边基本可以搞定,实在不行就修改为如下,加上单引号或者双引号

spring:
  profiles:
    active: '@profiles.active@'
展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部