- 工具:idea
- 问题描述:某天,前一次运行application还可以正常启动springboot项目,重启就出现启动失败,提示:
hile scanning for the next token found character '@' that cannot start any token. (Do not use @ for indentation)
大意就是在你的yaml配置文件中使用了InteliJ不能识别的@符号,众所周知,@@一般用于读取pom中的配置信息,例如:
spring:
datasource:
url: @jdbc_url@?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username: @db_username@
password: @db_password@
- 解决办法:到idea终端Terminal中,到项目目录下执行如下命令(和打maven包同理同目录)
mvn spring-boot:run
目的是让利用maven命令启动一次项目,把pom给解析了,关闭命令提示簿之后,再回到InteliJ里就可以启动了。