144

I can see the dependency hierarchy in Eclipse.
How can I do it in IntelliJ?

Pang
  • 9,564
  • 146
  • 81
  • 122
zjffdu
  • 25,496
  • 45
  • 109
  • 159

8 Answers8

142

I also like the Maven Helper Plugin.

Allows you to see dependencies as a tree, see conflicts, search in them. It looks a lot like the Eclipse tooling.

Notice the Text and Dependency Analyzer tabs that appear at the bottom of the POM editor panel. Click the analyzer tab to see results as shown in this screenshot.

screenshot of Maven Helper Plugin window

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
Ondrej Burkert
  • 6,617
  • 2
  • 32
  • 27
  • 6
    Not sure if this is new, but this functionality seems to be available in the built-in Maven Tool Window: https://imgur.com/NmvWcbJ – flow2k Jun 25 '19 at 22:08
  • 2
    The plugin allows you to see where different versions come from which is quite useful when resolving the "dependency hell" of clashing transitive versions. I also like the searchable tree view a lot. – Ondrej Burkert Jun 26 '19 at 13:43
  • 3
    This is the best plugin to have if you are working in jar hell :) The tree view and the means to exclude transitive dependencies is a god send. – Senthilkumar Gopal Jul 07 '19 at 23:29
  • 3
    Does this plugin work with gradle as well? It would be magnificent in that case :) – George Fandango Jul 31 '19 at 06:50
  • 2
    This is the only answer that is suitable for large project with a lot dependencies, should be accepted. This help to find out conflicts quickly & easily, other answer can't do that ! – Eric May 31 '20 at 09:12
97

You can try: Menu -> View -> Tool Windows -> Maven Projects

And then you can see new view openned.

Open your Dependencies tree, and you can see all the dependency hierarchy.

enter image description here

Aaric Chen
  • 1,138
  • 11
  • 12
  • 2
    But we can't filter and search for a particular dependency. There the plugin "https://plugins.jetbrains.com/idea_ce/plugin/7179-maven-helper" comes handy! – Mehul Parmar Nov 22 '21 at 06:49
64

Offical documentation: View Maven dependencies as a diagram

Open the pom.xml, right click anywhere in the editor and choose "Diagrams > Show Dependencies". It opens a dependency tree like those I'm attaching.

The main point is that this context menu appears only on opened pom.xml file (at least I couldn't managed to open it from anywhere else), if you just click on the file in the project tree, it won't be present.

Please note: You need to have UML Support and Maven Integration Extension enabled for this.

enter image description here

Adrian
  • 2,233
  • 1
  • 22
  • 33
Ivaylo D. Ivanov
  • 3,783
  • 1
  • 12
  • 16
18

Use the shortcut Luke! Ctrl + Alt + Shift + U

Or select View -> Tool Windows -> Maven Projects

...here you can either:

A) expand the Dependencies sub-tree,

or

B) select the project ("spring-boot" in my case), a new icon reveals itself

enter image description here

Jaroslav Záruba
  • 4,694
  • 5
  • 39
  • 58
4

Select Module or Directory and then Analyze from main menu

enter image description here

Cristian Florescu
  • 1,660
  • 20
  • 24
2

Menu -> View -> Tool Windows -> Maven Projects is impractical and must be collapsed one by one. I prefer the plujin mentioned by Basil Bourque in this post.

L-M
  • 53
  • 2
  • 7
2

I love this plugin Maven Helper, but for some reason it was crashing my IntelliJ:

IntelliJ IDEA 2020.2.1 (Community Edition)
Build #IC-202.6948.69, built on August 25, 2020

I tried updating from the marketplace from within IntelliJ, but for some reason it didn't help. I managed to solve this by installing it from the plugin website Maven Helper by clicking on "Install to IDE".

Dharman
  • 30,962
  • 25
  • 85
  • 135
atkuzmanov
  • 389
  • 5
  • 16
  • Here is the [plugin GitHub repo](https://github.com/krasa/MavenHelper) if you want to follow for updates or open issues. – atkuzmanov Oct 22 '20 at 07:26
1

As mentioned @Ondrej Burkert the Maven Helper Plugin you can select the pom.xml file and if the editor is open there are two tabs at the bottom. First is 'Text' and second is 'Dependency Analyser'. In the tab 'Dependency Analyser' you have a tree of all dependencies like in eclipse.