7

我在最新的 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 了吗?

不知道这意味着什么,有人吗?

4

1 回答 1

2

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

于 2019-02-08T13:44:31.937 回答