求大佬帮忙看看!!nested exception is java.io.FileNotFoundException: class path resource [email.properties] cannot be opened because it does not exist.

启动springboot项目时报错:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.aisino.GyxxdzApplication]; nested exception is java.io.FileNotFoundException: class path resource [email.properties] cannot be opened because it does not exist

在网上百度了都说是读取properties文件出错。
我注解都是正确的,启动的时候依然报错。

@Component
@ConfigurationProperties(prefix = "email")
@PropertySource(value = {"classpath:config/email.properties"})

代码部分
图片说明

请大佬们帮我看看怎么回事!!感谢感谢

看一下你的打包代码或调试运行时,文件是否在代码目录。你是把文件放在资源目录,可能拷贝命令有问题

这个不是java的吗?

你这个应该是springboot项目,未找到文件,直接把属性配置yml里面

检测项目打包的时候有没有把资源文件打包到类路径中去。

如果路径什么的都是正确的,请检查项目文件夹下是否有 target 文件夹。如果存在 使用 maven clean 清理或直接删除。