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 5, column 12:
appName: @project.artifactId@
^
在pom.xml中添加
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>
<!--必须添加,否则无法动态获取值-->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
application.yml的配置,要加双引号或单引号
info:
appName: "@project.artifactId@"
version: "@project.version@"
company: 测试项目
author: linhongwei
标签:appName,project,token,version,yml,artifactId From: https://www.cnblogs.com/xfeiyun/p/17524734.html