检查信息:验证@ConfigurationProperties 设置。 2018.3 中的新增功能

Inspection info: Verifies @ConfigurationProperties setup. New in 2018.3 IntelliJ

我在最新的 IntelliJ Idea 中得到以下提示:

Not registered via @EnableConfigurationProperties or marked as Spring 
component less... (Ctrl+F1) 
Inspection info: Verifies @ConfigurationProperties setup. New in 2018.3

配置如下:

@Configuration 
@ConfigurationProperties(prefix = "myapp.reference")
@EnableConfigurationProperties(MyAppFactoryConfiguration.class)
@Profile("dev")
public class MyAppLibraryConfigDev {

如果我添加@Component 它就消失了,但是@Configuration 不是已经是@Component 了吗?

不知道这是什么意思,有人吗?

它是 reported 并作为错误拒绝。因为将哑属性 PoJo(或 Bean)声明为 @Configuration 而不是更简单的 @Component 在语义上是不正确的(或不太可取的)。因为@configuration是一种特殊的@component,它可以自己生产Bean。