spring - how to set explicitly primary=false?

263 views Asked by At

I am building a jar dependency that will create a bean of a type that is likely to exist already in the apps that will use that dependency. I want to create a configuration spring class in the dependency to mark that bean as "secondary". How can we set explicitly a bean as secondary (or @Primary(value=false) ) in spring with annotations or with java config? There is also the autoWireCandidate on the @Bean annotation. But that is available only from the very young spring versions.

0

There are 0 answers