IntelliJ IDEA 2019.3 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

The Spring Beans Dependencies diagram lets you 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. Select Diagrams from the menu.

  3. Select Show Diagram Popup Ctrl+Alt+U to open the diagram in a local popup window, or Show Diagram Ctrl+Shift+Alt+U to open the diagram in the editor.

  4. 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 the Neighborhood mode Neighborhood mode icon.

Spring Application Context Dependencies diagram

The Spring Application Context Dependencies diagram lets you 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) and allow you 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. Select Diagrams from the menu.

  3. Select Show Diagram Popup Ctrl+Alt+U to open the diagram in a local popup window, or Show Diagram Ctrl+Shift+Alt+U to open the diagram in the editor.

  4. Click Spring Application Context Dependencies icon Spring Application Context Dependencies.

    Spring Application Context Dependencies diagram

Solid blue arrow

A solid blue line stands for @ComponentScan annotation dependencies.

Solid yellow arrow

A solid yellow line stands for @Enable annotation dependencies.

Dashed green arrow

A dashed green line stands for @Import annotation dependencies.

Dotted red arrow

Solid red arrow

Red lines stand for errors.

Dotted grey arrow

Dotted grey lines stand for other dependencies.

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 through @Component annotations); Spring implicit bean (service beans added by Spring that not defined explicitly).

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

The MVC tab allows you to view 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 will show you the list of repositories, their queries and their projection.

Last modified: 20 March 2020