intellij - spring is not being recognized (Unmapped Spring configuration)

I am using IntelliJ IDEA and all plugins for Spring are activated, but when I load my Maven project I have the following error:

Spring Configuration Check
Unmapped Spring configuration files found.
Please configure/setup Spring facet for modules

Any ideas what prevented it from being configured automatically?


Solution 1:

You need to do the following:

  1. Go to the project structure dialog (either by clicking the warning or through file=>project structure
  2. select the modules item in the left hand list
  3. go through and right click on the modules with missing files and select Add=>Spring
  4. in the new tab click the + button
  5. you should now see a list of the xml files. Check the boxes next to them

It's not entirely clear to me what this achieves apart from getting rid of the warnings! If anyone could shed any light on that it'd be good.

Solution 2:

You need to check which configurations IntelliJ will use to provide inspections on wired beans.

Go to FileProject StructureProject SettingsModules.

Select your module and selected (or add) the Spring facet.
In the right area you can add or modify application contexts that are used by your module. Just check every configuartion you need in your context.