项目场景:
问题描述
提示:这里描述项目中遇到的问题:
while scanning for the next token found character '@' that cannot start any token. (Do not use @ for indentation) in 'reader', line 4, column 13: active: @profileName@
原因分析:
提示:这里填写问题的分析:
解决方案:
提示:这里填写该问题的具体解决方案:
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
</dependency>
<resources>
<resource>
<directory>src/main/resources</directory>
<!--开启过滤,用指定的参数替换directory下的文件中的参数-->
<filtering>true</filtering>
</resource>
</resources>
<profiles>
<profile>
<id>dev</id>
<properties>
<profileName>dev</profileName> # 这里的名称要跟yml中的active名称一致
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>prod</id>
<properties>
<profileName>prod</profileName>
</properties>
</profile>
</profiles>