Spring boot

idea springboot的yml自动提示补全

2020-11-11  本文已影响0人  三也视界

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

添加以下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

For Gradle

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

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

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

image.png
上一篇下一篇

猜你喜欢

热点阅读