@spring.active@ Failed to load property source from location ‘classpath:/application.yml’

spring boot启动报错

[restartedMain] ERROR org.springframework.boot.SpringApplication – Application run failed
java.lang.IllegalStateException: Failed to load property source from location ‘classpath:/application.yml’

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 17, column 13:
active: @spring.active@
^

解决办法:

方式一:

在 application.yml中 将 active: @spring.active@ 加上英文引号,

改为 active: “@spring.active@”

方式二:

使用阿里云的maven仓库,在项目根目录右键,并点击maven的reimport。

spring-boot @spring.active@

 

 

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>