title: Intellij: "Could not autowire. There is more than one bean of 'MyType' type" With @ConditionalOnProperty
body: <p>In my spring boot app IntelliJ shows me the warning <code>Could not autowire. There is more than one bean of 'MyType' type.</code> </p>
  
  <p>In fact there are two beans but they are defined with condition on property</p>
  
  <pre class="lang-java prettyprint-override"><code>@Service
  @ConditionalOnProperty(name = "features.feature1", havingValue = "true")
  public class Bean1 implements SomeInterface{
  
  }
  </code></pre>
  
  <p>And the second one depends on the same property in <code>application.yml</code> but if it is set to <code>false</code></p>
  
  <pre class="lang-java prettyprint-override"><code>@Service
  @ConditionalOnProperty(name = "features.feature1", havingValue = "false", matchIfMissing = true)
  public class Bean2 implements SomeInterface{
  
  }
  </code></pre>
  
  <p>Is there a way to make IntelliJ understand this and don't show the warning? Project runs without problems. </p>