//application.yml
info:
appNAme: @project.artifactId@
version: @project.version@
author: max
项目启动报错:
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 21, column 12:
appNAme: @project.artifactId@
解决方案:
<!--pom.xml-->
<resources>
<resource>
<directory>src/main/resources</directory>
<!--开启过滤,用指定的参数替换directory下的文件中的参数-->
<filtering>true</filtering>
</resource>
</resources>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<!-- 指定过滤的表达式
<delimit>@</delimit> : 表示 过滤开头为 @ 结束为 @ 的内容,例如 @project.version@
<delimit>${*}</delimit> 表示 过滤${}包裹的内容,例如 ${project.vserion}
-->
<delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>