Affects: 5.3.2

Spring provides the CustomAutowireConfigurer that allows for registration of custom autowire qualifier types.

In certain scenarios, e.g. when using org.springframework.beans.factory.InjectionPoint, it might be useful to have the ability to ignore certain @Qualifier annotations altogether (basically the inverse behavior).

For instance, users may have the need to reuse custom 3rd party annotations that happen to be annotated with javax.inject.Qualifier. Right now there seems to be no easy way to simply pass them down into the @Bean method and handle the annotation via InjectionPoint. Please see also issue #26302.

Related to this, I also observed a problematic behavior around javax.inject.Qualifier:

A user may use a third-party annotation that is annotated with javax.inject.Qualifier, without having the relevant JSR-330 dependency on the classpath. In that case Spring will NOT detect the annotation as a Qualifier and the annotation can be handled by via InjectionPoint. This is certainly expected behavior.

However, as soon as the JSR-330 dependency has been added, the application will break as all of a sudden the annotation is treated as a Qualifier. I understand that this is more of an edge-case, but I wonder if the user-experience could be improved here as the exception may not be the most intuitive. Please let me know if I shall rewrite this as a separate issue.

Comment From: snicoll

Thanks for the suggestion but I don't think that ignoring qualifiers is a good idea. We're certainly looking at simplifying things in that area rather than the opposite. As for the second bit in your issue, this is unrelated. If you consider you've found a bug, please create a separate issue with a small sample as I am not sure I understood it.