检验信息:验证@ConfigurationProperties设置.新的2018.3 IntelliJ

pow*_*366 7 intellij-idea intellij-idea-2018

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

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

使用以下配置:

@Configuration 
@ConfigurationProperties(prefix = "myapp.reference")
@EnableConfigurationProperties(MyAppFactoryConfiguration.class)
@Profile("dev")
public class MyAppLibraryConfigDev {
Run Code Online (Sandbox Code Playgroud)

如果我添加@Component,它会消失,但@Configuration不是@Component吗?

不确定这意味着什么,有人吗?

小智 3

它被报告为错误并被拒绝。因为将哑属性 PoJo (或 Bean)声明为 a@Configuration而不是更简单的@Component. 因为a@configuration是一种特殊的类型@component,它本身可以产生Bean。