【Java开发框架SpringBoot】消除Spring Boot Configuration Annotation Processor not configured警告

当给类加上 @ConfigurationProperties 注解时会出现Spring Boot Configuration Annotation Processor not configured警告(如下图:)

在这里插入图片描述
这种问题不是报错,是编译器的警告提示。(未配置Spring Boot配置注释处理器)

解决:

点击右上角的Open Documentation,会打开一个页面。

在这里插入图片描述

<dependency> 
	<groupId>org.springframework.boot</groupId> 
	<artifactId>spring-boot-configuration-processor</artifactId> 
	<optional>true</optional> 
</dependency>

加上这个maven依赖:使用注释处理器生成自己的元数据,加上之后警告提示就消失了。

注意:添加完依赖刷新pom之后,需要重新启动一下项目。

加上这个maven依赖之后,在编写配置文件的时候还会有很人性化的提示。

在这里插入图片描述
在这里插入图片描述

总结

如果觉得不错,可以点赞+收藏或者关注下博主。感谢阅读!

猜你喜欢

转载自blog.csdn.net/weixin_42825651/article/details/109203828
今日推荐