在我的春季启动应用程序IntelliJ中,向我显示警告Could not autowire. There is more than one bean of 'MyType' type.
实际上有两个bean,但是它们是在属性条件下定义的
@Service
@ConditionalOnProperty(name = "features.feature1", havingValue = "true")
public class Bean1 implements SomeInterface{
}
第二个依赖于application.yml
中的相同属性,但是如果它设置为false
@Service
@ConditionalOnProperty(name = "features.feature1", havingValue = "false", matchIfMissing = true)
public class Bean2 implements SomeInterface{
}
有没有办法让IntelliJ理解这一点并且不显示警告?项目运行没有问题。