IntelliJ IDEA 2020.2 Help

Spring diagrams

Spring diagrams help you analyze dependencies in your application. You can double-click a bean or a file on a diagram to open it in a dedicated tab in the editor.

Spring Beans Dependencies diagram

Use the Spring Beans Dependencies diagram to view and analyze dependencies between beans in your project.

Open the diagram

  1. Right-click the bean for which you want to build a diagram.

    You can also build a diagram for a class to see beans and their dependencies inside this class.

  2. From the context menu, select Diagrams | Show Diagram Ctrl+Alt+Shift+U.

    This opens the diagram in a separate editor tab. To open it in a popup window, select Diagrams | Show Diagram Popup Ctrl+Alt+U.

  3. In the Select Diagram Type popup menu, click the Spring Beans Dependencies icon Spring Beans Dependencies.

The Spring Beans Dependencies diagram

If you want to view only direct dependencies between beans on the diagram, select Show Neighbours of Selected Nodes Neighborhood mode icon in the diagram toolbar.

Spring Application Context Dependencies diagram

Use the Spring Application Context Dependencies diagram to view dependencies between multiple configuration files and analyze how they include and reference each other. Red arrows on the diagram mark errors (such as circular dependencies) to easily spot and remove them from your Spring configuration.

Open the diagram

  1. Right-click the configuration file for which you want to build a diagram.

  2. From the context menu, select Diagrams | Show Diagram Ctrl+Alt+Shift+U.

    This opens the diagram in a separate editor tab. To open it in a popup window, select Diagrams | Show Diagram Popup Ctrl+Alt+U.

  3. In the Select Diagram Type popup menu, click the Spring Application Context Dependencies icon Spring Application Context Dependencies.

Spring Application Context Dependencies diagram

The Spring application context dependencies diagram uses the following arrows:

Solid blue arrowA solid blue line stands for @ComponentScan annotation dependencies.
Solid yellow arrowA solid yellow line stands for @Enable annotation dependencies.
Dashed green arrowA dashed green line stands for @Import annotation dependencies.
Dotted grey arrowDotted grey lines stand for other dependencies.
Dotted red arrow
Solid red arrow
Red lines stand for errors.

Browse dependencies in the Spring tool window

To access the Spring tool window, go to View | Tool Windows | Spring.

The Spring tool window helps you navigate between Spring components and dependencies. You can view definitions for Spring beans used in your project, and see how they are related to other beans.

Spring tool window

The Beans tab shows definitions for Spring beans used in your project, their documentation, and how they are related to other beans. Each bean is marked with an icon:

  • Spring bean: Beans defined in XML files.

  • Spring Java bean: Auto-discoverable beans declared with @Component annotations.

  • Spring implicit bean: Service beans added by Spring that are not defined explicitly.

Use icons on the left toolbar to change the way beans are displayed, view documentation, or build a graph.

The MVC tab shows controller mappings for the Spring MVC framework. You can also use the Spring Request method icon Request Method option to filter mappings by HTTP method.

If your configuration comprises Spring Data, the Data tab shows the list of repositories, their queries and projection.

Last modified: 02 June 2020