idea springboot的yml自动提示补全

file—>setting–>plugin 搜索spring assistant安装

确定是否允许annotation processing,打卡 Settings > Build, Execution & Deployment > Compiler > Annotation Processors
Make sure you add the following changes to to your project

image.png

For Maven

添加以下依赖

org.springframework.boot
spring-boot-configuration-processor
true

For Gradle

添加
dependencies {
optional "org.springframework.boot:spring-boot-configuration-processor"
}

如果项目里面的application的配置文件后缀为properties改为yml,两种配置文件只是语法有区别,这里因为习惯yaml的写法所以,倾向于使用yml

打开src\main\resources\application.yml,尝试输入,可以看到提示成功

image.png

你可能感兴趣的:(idea springboot的yml自动提示补全)