Maven Dependencies Diagram

Anyone working on large Maven projects knows well about how hard it is to keep in mind all the dependencies between modules and libraries; and even harder, to resolve conflicts between them. We’ve greatly improved Maven Dependencies Diagram to make this whole thing a lot simpler.

There are several approaches to resolving dependency conflicts, and so we created a special layout that shows you dependencies (nodes) in the exact order as they are defined in pom.xml files. This differs from other Maven dependency diagrams: for example, in Eclipse this diagram looks like this:


It’s hard to understand and impossible to navigate from node to node by keyboard. All artifacts with different version numbers are merged (multiple incoming links per node), and there are no visible conflicts. IntelliJ IDEA shows you dependency layout exactly in the order they are defined in pom.xml

It’s easy to find your modules on diagram — they all are blue, as well as test dependencies are green. Conflicting dependencies are marked red, and you can find what they conflicted with by selecting one of them:

You can fix a conflict by excluding a dependency. IntelliJ IDEA will offer all places where it’s possible to add the exclusion definition:

Navigation from nodes to POM files is also convenient. Each dependency links directly to the place where it was defined:

On huge dependency diagrams it is useful to use scope filter to decrease number of nodes:

Maven Dependencies Diagram will be available in the first EAP of IntelliJ IDEA 10. Your suggestions and feature requests are welcome.

This entry was posted in New Features and tagged , , . Bookmark the permalink.

31 Responses to Maven Dependencies Diagram

  1. Paul says:

    Does it support Ivy dependencies too?

  2. wax says:

    That’s awesome. Can’t wait to see it in action.

  3. Ashitkin Alexander says:

    Amazing. this is really cool. as i see dependencies coloured in a different way. is it because of a different scope?

  4. Simon Knott says:

    Looks a great improvement!

    Is it possible to print the dependency diagrams yet? That would help massively when trying to sort out multi-module dependency conflicts.

  5. Simon Knott says:

    As for a feature request, I’d still love to be able to get a reverse-dependency graph for Maven-imported libraries if that’s possible. i.e. Select a library which has been imported by Maven and then see exactly how that’s pulled in across the project.

  6. Stefan A. says:

    +1, that’s cool stuff. Would really love to this for Grails dependencies too! Since Grails uses Ivy under the hood, that should not be a big issue.

  7. Faster, please.

    IDEA 8 was excellent, big step over 7. IDEA 9 was even better, big step over 8. With improvements like these, IDEA 10 looks to be amazing.

  8. Frustrated says:

    Useless article. Wonderfull pics. Could you try again start at the beginning of the story (instead of the middle) and tell us how to get the maven dependancy diagram

  9. Konstantin Bulenkov says:

    2Alexander: yes, it is so. Project modules are colored in blue, test scope in green (as usual).
    Also, there are few features I forgot to mention about.
    + You can detect duplicates: http://i50.tinypic.com/r2j9f4.png
    + You can use standard Ctrl+F12 to see all nodes in popup and navigate quickly. Very useful on huge diagrams

  10. Bala says:

    In Eclipse plugin screenshot, in case of conflicts (same dependency from multiple sources), in a single glance I can see the final version of the dependency that will be used. Is there anyway we can achieve that here also?

  11. Kris Schneider says:

    Very nice. Any chance that this will also support Ivy? If not, it would be helpful if the feature were implemented in such a way as to make it (relatively) easy to come up with a plugin for Ivy support.

  12. Dirk Dittert says:

    There’s only one word for that: awesome!

  13. John Hurst says:

    This is great, but we use (Ant+)Ivy.

    Any chance of Ivy support for this? Any chance of 1st-class Ivy support in IDEA (rather than a 3rd party plugin)?

    John Hurst

  14. Erik Pragt says:

    This feature looks pretty cool indeed! I hope this also means, since it’s related to project dependencies, that the module dependencies come back in the project, instead of only the ‘project dependencies’ (while in my case, there’s no such thing as ‘project dependencies’. All modules have dependencies, not the “project”!)

    Erik

  15. Konstantin Bulenkov says:

    2Simon Knott: Sure, here Print action is selected http://i48.tinypic.com/2l8uefs.png
    Also, it’s possible to save diagram to gif, png, jpg to use in documentation.

  16. Konstantin Bulenkov says:

    Ivy is not IntelliJ IDEA’s bundled plugin. But if we decide to bundle it or write our own support for Ivy, diagrams will be there with no doubt. Anyway, authors of Ivy plugin can contact me and I can tell them about UML-API in intelliJ IDEA to create such diagrams in one day.

  17. Jens Nerup says:

    Konstantin Bulenkov, I’ll be interested in knowing more about the UMP-API to create such a diagram for Ivy.

  18. Konstantin Bulenkov says:

    @Jens Nerup: I’ve sent you details about UML-API by e-mail.

  19. Constantine Plotnikov says:

    Ivy support is planned for IDEA 10. However it is not yet clear if the first version of the support will include diagrams. The priority is automatic management of libraries provided through ivy and support for resolving artifacts.

  20. Oleh says:

    Will it be available in IDEA Community Edition?

  21. Konstantin Bulenkov says:

    @Oleh Unfortunately it won’t. We can’t use the diagramming library in free version of IntelliJ.

  22. Timothy Lee says:

    Great!
    Would this work with parent-pom’s too though?
    For example, if the parent pom defines the versions of dependencies using dependencyManagement, and my project’s pom only refers to the groupId and artifactId without the version, would it still produce the maven diagram?

  23. @Timothy, try out IntelliJ IDEA X EAP: http://confluence.jetbrains.net/display/IDEADEV/IDEA+X+EAP
    And, of course, you’re welcome to post bugs/feature_requests against IDEA 10 here: http://youtrack.jetbrains.net

  24. Arseny Sizov says:

    Could you please include ivy support of any kind in IDEA 10. Currently it block us from moving from IDEA 9.

  25. yole says:

    Arseny,
    Unfortunately we don’t plan to include an official Ivy plugin in IntelliJ IDEA 10 (which has already been released, and thus feature-complete). You can contact the developers of existing third-party Ivy plugins and ask them to update the plugins for IDEA 10 compatibility.

  26. Bob says:

    I have a IntelliJIDEA 10 Ultimate trial version. How do I bring up the dependency editor?

    Thanks

  27. Hello Bob!
    The dependency editor? To edit pom files? You can navigate from node to corresponding place in pom file by pressing F4 on a diagram.

  28. Rob Juurlink says:

    Works great! But how to zoom the diagram?

    My Maven project generates a huge diagram. To fit in the window, the diagram is scaled down, but now the text is so small I cannot read the version numbers. How the enlarge?

  29. Use Alt+Mouse or Ctrl+MouseWheel to zoom. Also, Ctrl+F12 works fine for navigation

  30. Guillaume says:

    Any way I can find the usage of a given maven module in my project by other modules in that same project ?

    I tried find usage on the pom.xml but it does not find other pom.xml referencing it.

    Did I miss something?

  31. Suresh says:

    Is there a way to hide dependencies in the graph , I don’t want to exclude them just want to reduce the noise and filter some artifacts that I don’t want to see

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>