Maven Dependency Battle: Eclipse x IntelliJ

I’m a avid user o JetBrains IntelliJ IDEA, but I can’t forget the eight years plus using Eclipse. Even though the maven integration via m2e plugin was awful in the early days, one thing for that it got it right was the Dependency Tree Tab of the POM Editor:
OSS Sonatype - Dependency Tree

It’s dead simple to see conflicts, search for libs and take a quick look at those legacy monsters that you keep in your closet.

Since I’ve switched to IntelliJ, I’ve always had trouble using it’s Maven Dependency map to do simple tasks; while useful
and beautiful
, the diagram is quite useful only if you have a few dependencies on your project, as you can see in the image below:
Maven Dependencies Diagram


The documentation for that is also too simple for me, which forgets to address most of the issues that a developer faces when dealing with scope and problematic dependencies, showing only a few howto of basic things you can do with Maven inside intelliJ.

Puzzled by that, I’ve searched on how I could improve that in IntelliJ and found the Maven Helper plugin:
Maven Helper @ plugin screen

After installing, open any Maven POM file and you’re presented a new tab with the Dependency Analyzer:
Dependency Analyzer

A few things can go wrong while working with Maven 3 as you can see in the warning when trying to find conflicts:
Maven3 conflict

The description is self-explanatory and you can find the fix in the JetBrains Issue
IDEA-133331 or simply:

  • File > Settings (ctrl+alt+s) > Build, Execution, Deployment > Build Tools > Maven > Importing > VM options for importer:
    • if your IntelliJ version is lower than 14.1 add -Dmaven3.use.compat.resolver
    • on the other hand if your version is higher than 14.1 use -Didea.maven3.use.compat.resolver

And that is it, now you have the best of the two worlds in your new favorite IDE.

That’s it for today, I hope you all enjoy the reading and keep it posted for more news by following me

Leave A Comment

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