@ConfigurationProperties 注释警告

Nar*_*y M 7 java spring spring-boot

我可以看到带有@ConfigurationProperties 注释的以下警告

When using @ConfigurationProperties it is recommended to add 'spring-boot-configuration-processor' to your classpath to generate configuration metadata

一切正常。它的意思是什么?

Meb*_*Joe 6

如果您向 \xe2\x80\x9cspring-boot-configuration-processor\xe2\x80\x9d 添加可选依赖项,您的模块将保存一个在编译时生成的元数据文件,其中包含有关您的属性的详细信息。然后 IDE 可以选择它来向您显示内容辅助/自动完成。STS、Intellij IDEA 和 Netbeans 都有这样的支持。\n它是一个注释处理器,可生成有关应用程序中用@ConfigurationProperties.

\n\n

更多信息在这里:http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#configuration-metadata

\n\n

https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#configuration-metadata-annotation-processor

\n