【发布时间】:2023-03-17 17:56:01
【问题描述】:
我在库中有一个自定义命名的属性文件,例如foo.properties 然后我将其加载到配置类中,如下所示:
@Configuration
@PropertySource({"/foo.properties"})
public class FooConfiguration {}
IntelliJ 不会将 foo.properties 识别为 Spring 属性文件,并且不会自动完成它。有没有办法提示 IntelliJ 将其视为 Spring 属性文件?
【问题讨论】:
-
我不确定,但也许 pom.xml 中的
可以帮助你${basedir}/src/main/resources -
文件夹已被标记为资源 :(
标签: java spring spring-boot intellij-idea spring-properties