IDEA版本:IntelliJ IDEA 2020.3.2 x64
1、配置文件不显示绿叶,将配置文件加入到spring配置文件
2、添加 spring-boot-configuration-processor 依赖
这个是对配置类自动提示,配置类加了@ConfigurationProperties 和添加META-INF/spring-configuration-metadata.json元数据配置后,可以在application配置文件提示属性。
3、安装SnakeYAML plugin和Spring Assistant两种插件。
4、检查File Types中是否支持json后缀的文件
由于springboot 的属性配置通过 spring-boot-test-autoconfigure模块 起作用,autofiguration 加载配置读取失败,因为IDEA中没有配置相关类型文件。