Maven: How can I find the module which use a dependency?

Today I've been fighting with the maven support, i.e. I'm really frustrated with it (build 95.24).

I have several modules, all maven based and I see the long list of dependencies in the project view.

It includes several libs, some in different versions.

Now I want to check where the different versions come from. I thought Find usages worked on a lib but it doesn't.

So, how can I find the modules which use a certain library?

Regards,
Wallaby

6 comments

I feel your pain, I started a thread a few weeks ago on the same issue here

0

Use the Maven dependency plugin to produce a report, such as:

> mvn dependency:tree

Or if you simply want the discrepancies, use

> mvn dependency:analyze-dep-mgt

Or use the site plugin to produce the dependency reports..

0

In addition to the already suggested solutions:

Option 1.
Use Maven dependency graph (I am not sure it is available in the community edition though).
There's no search option there, and you've already filed IDEA-53025 to cover that (which I have already voted for).


Option 2.
In the project tree:
1. Open "External Dependencies"
2. Open "Maven: group:artifact:version" node
3. Select the jar file, press Alt+F1, select in Project Structure.
You end up in another long list of libraries, but from there you can use Alt+F7 to jump to locate the module it's referenced from.

0

I've tried Option 2 and it doesn't do anything for me.  I select the Jar and select it in the project structure and nothing changes.  Also, Alt-F7 does nothing from the selected Jar file.

Are you using Idea 9?

0

Yes, I am using one of the latest EAP versions (IU-95-24).

You can go straight to Project Structure > Project Settings > Libraries page, then select a "Maven:"-prefixed library and press Alt+F7 (of a "magnifying glass" toolbar button above the library list).

0

Ah that I know about, I thought you were talking about doing that from the project view

  Thanks anyway!
0

Please sign in to leave a comment.