Spring custom annotation is not recognized as @Autowired analogue


Could someone describe me how to configure Idea to recognize custom Spring annotations?

I'm using Spring and java-configs, Spring facet is added to my modules, so each bean annotated by @Autowire and declared in @Configuration class is shown correctly. But we have custom annotation like

@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public @interface CustomController {


and beans that are annotated by it are not recognized by Idea:

  • methods in @Configuration file is marked as never used
  • injection in another class is marked as invalid  with message "Could not autowire. No beans of '...' type found."

public class MasterdataRequestConfiguration {

    MasterdataRequestController masterdataRequestController() {
        return new MasterdataRequestController();

    TerminalAttributesService terminalAttributesService() {
        return new TerminalAttributesService();


terminalAttributesService is injected without warnings but masterdataRequestController is not found by Idea with such configuration's file.

Is there any way to point that this annotation is a @Bean too?
Please note that I don't want to disable this check - it can be very useful.
Comment actions Permalink

What version of IntelliJ IDEA do you use?

Comment actions Permalink

I'm using version 15.0.2.
Do you mean that such annotations are recognized somewhere? :)

Comment actions Permalink

Sorry, indeed meta-annotations for "@Bean" are not supported currently. Please watch https://youtrack.jetbrains.com/issue/IDEA-149463 for progress. Thanks for reporting!


Please sign in to leave a comment.