IntelliJ IDEA
 
Get IntelliJ IDEA

Add Spring support to existing project

Last modified: 11 October 2024

IntelliJ IDEA automatically detects Spring in your project based on the XML configuration or @Configuration annotations. Normally, a Spring project does not require manual configuration, and most of the features are available without adding the Spring facet.

However, if you have multiple Spring application contexts, you have to map existing configuration files to application contexts so that IntelliJ IDEA provides correct coding assistance and enables gutter icons in bean definitions. The IDE will inform you if the project requires additional configuration, and a warning will be displayed on top of a configuration file if it is not mapped to any application context. You can also check the Spring configuration using the dedicated action. To map you configuration files to application contexts, you have to do the following:

If your project is correctly configured, you will see Spring gutter icons marking each component, bean, and so on. To configure gutter icons, open the IDE settings with CtrlAlt0S and go to Editor | General | Gutter Icons.