错误信息:
Caused by: java.lang.IllegalStateException: Attempted to load applicationConfig: [file:../config/application.yml] but snakeyaml was not found on the classpath
打包后运行程序提示加载配置文件异常,在pom.xml增加
<dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> <version>1.23</version> </dependency>
后重新编译打包解决!此问题常见于使用assembly打包项目时。