# Spring diagrams

> **TL;DR**
> Required plugins: Spring and Diagrams (bundled)

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.

> **Tip:**
> For Spring Boot, you can also build the [Runtime Beans diagram](spring-boot.html#endpoints-beans).

## Spring Beans Dependencies diagram

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

Procedure: Open the diagram

1. In the gutter, click the bean icon ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring.icons.expui.gutter.springBean%4014x14.svg) (for Java or Kotlin files) or the diagram icon ![Spring diagram icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring.icons.expui.gutter.springDiagrams%4014x14.svg) (for XML files).

![Spring gutter icon actions](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_gutter_icon_actions.png)

2. Select Beans Dependencies Diagram.

Alternatively, right-click a file and, from the context menu, select `Diagrams | Show Diagram | Spring Beans Dependencies` `Ctrl+Alt+Shift+U` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)).

![The Spring Beans Dependencies diagram](https://resources.jetbrains.com.cn/help/img/idea/2026.2/beans-dependencies.png)

This opens the diagram in a separate editor tab. To open it in a popup window, right-click a file and select Diagrams | Show Diagram Popup `Ctrl+Alt+U` (Windows), `⌘ ⌥ U` (macOS), `⌘ ⌥ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ U` (macOS System Shortcuts), `Ctrl+Alt+U` (XWin), `Ctrl+Alt+U` (GNOME), `Ctrl+Alt+U` (KDE), `Ctrl+Alt+U` (Emacs), `Ctrl+Alt+U` (Sublime Text), `⌘ ⌥ U` (Sublime Text (macOS)), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS)).

You can also access the bean dependencies diagram by clicking the diagram icon ![Spring diagram icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring.icons.expui.springDiagrams.svg) in the [Spring tool window](spring-tool-window.html).

To view only direct dependencies between beans on the diagram, click ![Neighborhood mode icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.graph.nodeSelectionMode.svg) (Show Neighbours of Selected Nodes) in the diagram toolbar.

To show library beans on the diagram, click ![Libraries icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.nodes.library.svg) (Show beans from libraries) in the diagram toolbar.

## Spring Context Dependencies diagram

Use the Spring 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.

Procedure: 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` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)).

This opens the diagram in a separate editor tab. To open it in a popup window, select Diagrams | Show Diagram Popup `Ctrl+Alt+U` (Windows), `⌘ ⌥ U` (macOS), `⌘ ⌥ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ U` (macOS System Shortcuts), `Ctrl+Alt+U` (XWin), `Ctrl+Alt+U` (GNOME), `Ctrl+Alt+U` (KDE), `Ctrl+Alt+U` (Emacs), `Ctrl+Alt+U` (Sublime Text), `⌘ ⌥ U` (Sublime Text (macOS)), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS)).

3. In the Select Diagram Type popup menu, click ![the Spring Context Dependencies icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring.icons.springDiagrams.svg) Spring Context Dependencies.

![Spring Context Dependencies diagram](https://resources.jetbrains.com.cn/help/img/idea/2026.2/model-dependencies.png)

The Spring context dependencies diagram uses the following arrows:

| ![Solid blue arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_graph_componentScan_dependency.png) | A solid blue line stands for `@ComponentScan` annotation dependencies. |
| ![Solid yellow arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_graph_enable_dependency.png) | A solid yellow line stands for `@Enable` annotation dependencies. |
| ![Dashed green arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_grapgh_import_dependency.png) | A dashed green line stands for `@Import` annotation dependencies. |
| ![Dotted gray arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_graph_other_dependency.png) | Dotted gray lines stand for other dependencies. |
|  ![Dotted red arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_graph_error_dependency.png) ![Solid red arrow](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_graph_error2_dependency.png)  | Red lines stand for errors. |

