Can Spring profile panel be enabled for Spring @Configuration?


I have a bean Foo that needs to have bean Bar injected into it. Bar is defined in a @Configuration class with @Profile("testing"). IDEA's complaining that Foo can't find Bar, because it doesn't know that "testing" is the active profile for Foo (the error goes away if I set Foo to @Profile("testing"), but that's not what I need to achieve.)

This seems like a gap in IDEA's Spring 3.1 support. Even creating a dummy XML file and setting the active profile to "testing" doesn't fix the wiring of Foo. It seems like the active profile setting is only affecting the file with the status bar, and not the project a a whole.

Any help would be appreciated.


PS. My code tells a DispatcherServlet that "testing" is the active profile using "" init-param, but IDEA obviously has no clue this is happening.

1 comment
Comment actions Permalink

The profile issue was a complete red herring. The cause of the problem is unrelated to profiles and is caused by incorrect handling of @Configuration in IDEA.

I've created a JIRA here.



Please sign in to leave a comment.