原文链接:maven多环境IDEA启动报Do not use @ for indentation错误解决方法
maven多环境配置如下:
<profiles>
<profile>
<id>devid>
<properties>
<profileActive>devprofileActive>
properties>
<activation>
<activeByDefault>trueactiveByDefault>
activation>
profile>
<profile>
<id>testid>
<properties>
<profileActive>testprofileActive>
properties>
profile>
<profile>
<id>prodid>
<properties>
<profileActive>prodprofileActive>
properties>
profile>
profiles>
application.yml使用如下:
spring:
profiles:
active: @profileActive@
报错如下:
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: @profileActive@
解决方案如下:
<resources>
<resource>
<directory>src/main/resourcesdirectory>
<filtering>truefiltering>
resource>
resources>