How can i exclude spring bean from autowiring candidates for multiple profiles?
<p>I want to exclude bean from autowiring candidates if current profile is NOT one of array, like this:</p>

<pre><code>@Component
@ActiveProfiles(value = {"!profile_1", "!profile_2"})
public class MyComponentImpl implements MyComponent

@Component
public class MyComponentDummy implements MyComponent
</code></pre>

<p>But when i'm trying to do it via @ActiveProfiles annotation that bean doesn't seem to be excluded and i'm getting <code>expected single matching bean but found 2</code>. </p>

<p>Am i missing something or it is impossible that way and must be done with something like</p>

<pre><code>@ActiveProfiles(value = {"profile_3", "!profile_4", ... }) 
</code></pre>

<p>My spring version is 4.2.2</p>