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

来源:5-1 SpringBoot 资源文件属性配置

慕哥0085313

2021-01-04 12:24

http://img.mukewang.com/5ff2980100012f6219201005.jpg

在5-1配置PropertySource遇到了问题。一直显示resource.properties不存在。详情大佬大佬帮忙解决, 非常感谢

写回答 关注

2回答

  • zozor_訣擇0_0
    2021-01-18 21:19:07

    ?1楼老哥说的在理,检查一下pom.xml文件有没有引入jar包

  • BinaryRhythm
    2021-01-14 21:20:09

    看不到你的pom.xml,可能依赖没加么,检查这几个地方看看:

    1、手工在src/main/resources目录下是否新建 resource.properties文件,可以直接负责application.properties文件放在同目录下,重命名为resource.properties即可;

    2、

    @Configuration

    ……

    这些代码是否写正确了。

    3、pom.xml中依赖

    <dependency>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-configuration-processor</artifactId>

    <optional>true</optional>

    </dependency>

    是否加了。


    Binary...

    负责 改 复制

    2021-01-14 21:21:11

    共 1 条回复 >

SpringBoot开发常用技术整合

SpringBoot 极简开发的框架整合利器

102157 学习 · 507 问题

查看课程

相似问题