> 文档中心 > SpringBoot 项目打包后不加载 application.properties 配置文件

SpringBoot 项目打包后不加载 application.properties 配置文件

今天打完项目jar,Linux启动时,发现总是报错,找不到application.properties配置文件

class path resource [applicationContext.xml] cannot be opened because it does not exist

推测原因是打包未扫描(没有找到)到这个配置文件,修改办法如下:

添加pom文件中的打包资源即可:

src/main/java**/*.yml**/*.properties**/*.xmlfalsesrc/main/resources**/*.yml**/*.properties**/*.xmlfalse

老江饲料商城