# Spring ダイアグラム

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/idea/llms.txt).

> **TL;DR**
> 必要なプラグイン:  Spring  と  ダイアグラム （バンドル）。

Spring ダイアグラムは、アプリケーションの依存関係を分析できます。 ダイアグラム上の Bean またはファイルをダブルクリックすると、エディター内の専用のタブで開くことができます。

> **Tip:**
> Spring Boot については、 [ランタイム Bean のダイアグラム](spring-boot.html#endpoints-beans)を構築することもできます。

## Spring Bean の依存関係ダイアグラム

Spring Bean 依存関係   ダイアグラムを使用して、プロジェクト内の Bean 間の依存関係を表示および分析します。

Procedure: ダイアグラムを開く

1. ガターで、bean アイコン ![](https://resources.jetbrains.com/help/img/idea/2026.3/spring.icons.expui.gutter.springBean%4014x14.svg) (Java または Kotlin ファイルの場合) またはダイアグラムアイコン ![Spring diagram icon](https://resources.jetbrains.com/help/img/idea/2026.3/spring.icons.expui.gutter.springDiagrams%4014x14.svg) (XML ファイルの場合) をクリックします。

![Spring ガターアイコンアクション](https://resources.jetbrains.com/help/img/idea/2026.3/spring_gutter_icon_actions.png)

2. Bean 依存関係ダイアグラム   を選択します。

または、ファイルを右クリックし、コンテキストメニューから  `ダイアグラム｜ダイアグラムを表示｜Spring Beans の依存関係`  `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` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)) を選択します。

![Spring Bean の依存関係ダイアグラム](https://resources.jetbrains.com/help/img/idea/2026.3/beans-dependencies.png)

これにより、ダイアグラムが別のエディタータブで開きます。 ポップアップウィンドウで開くには、ファイルを右クリックして   ダイアグラム | ダイアグラムポップアップの表示   `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` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS)) を選択します。

[Spring ツールウィンドウ](spring-tool-window.html)のダイアグラムアイコン ![Spring diagram icon](https://resources.jetbrains.com/help/img/idea/2026.3/spring.icons.expui.springDiagrams.svg) をクリックして、bean 依存関係ダイアグラムにアクセスすることもできます。

ダイアグラム上の Bean 間の直接的な依存関係のみを表示するには、ダイアグラムツールバーで ![Neighborhood mode icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.graph.nodeSelectionMode.svg) (   選択したノードの近隣を表示   ) をクリックします。

ダイアグラムにライブラリ Bean を表示するには、ダイアグラムツールバーの ![Libraries icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.nodes.library.svg) (   ライブラリの Bean を表示   ) をクリックします。

## Spring コンテキスト依存性ダイアグラム

Spring コンテキスト依存関係   ダイアグラムを使用して、複数の構成ファイル間の依存関係を表示し、それらが相互にどのように含まれ、参照しているかを分析します。 ダイアグラムの赤い矢印は、エラー（循環依存関係など）をマークし、Spring 構成から簡単に見つけて削除します。

Procedure: ダイアグラムを開く

1. ダイアグラムを作成する構成ファイルを右クリックします。

2. コンテキストメニューから   ダイアグラム | ダイアグラムの表示   `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` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)) を選択します。

これにより、ダイアグラムが別のエディタータブで開きます。 ポップアップウィンドウで開くには、   ダイアグラム | ダイアグラムポップアップの表示   `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` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS)) を選択します。

3. ダイアグラムタイプの選択   ポップアップメニューで、 ![the Spring Context Dependencies icon](https://resources.jetbrains.com/help/img/idea/2026.3/spring.icons.springDiagrams.svg)   Spring コンテキスト依存関係   をクリックします。

![Spring コンテキスト依存性ダイアグラム](https://resources.jetbrains.com/help/img/idea/2026.3/model-dependencies.png)

Spring コンテキスト依存関係ダイアグラムでは、次の矢印が使用されます。

|  ![青い矢印](https://resources.jetbrains.com/help/img/idea/2026.3/spring_graph_componentScan_dependency.png)  |  実線の青い線は、  `@ComponentScan`  アノテーションの依存関係を表します。  |
|  ![黄色の矢印](https://resources.jetbrains.com/help/img/idea/2026.3/spring_graph_enable_dependency.png)  |  実線の黄色の線は、  `@Enable`  アノテーションの依存関係を表します。  |
|  ![破線の緑色の矢印](https://resources.jetbrains.com/help/img/idea/2026.3/spring_grapgh_import_dependency.png)  |  破線の緑色の線は、  `@Import`  アノテーションの依存関係を表します。  |
|  ![灰色の点線矢印](https://resources.jetbrains.com/help/img/idea/2026.3/spring_graph_other_dependency.png)  |  灰色の点線はその他の依存関係を表します。  |
|  ![赤い点線の矢印](https://resources.jetbrains.com/help/img/idea/2026.3/spring_graph_error_dependency.png) ![赤い矢印が点灯](https://resources.jetbrains.com/help/img/idea/2026.3/spring_graph_error2_dependency.png)  |  赤い線はエラーを表します。  |

