How to determine where a dependency is used? (Java, Maven)

Viewed 2373

When using Maven with Java, is it possible to see where a dependency is used? Specifically to know which classes in your project import a class from a given dependency?

This is especially difficult when the package naming of the class and the dependency declaration's tags do not line up.

For example, given a POM which contains a dependency:

<dependency>
  <groupId>org.company.project</groupId>
  <artifactId>someartifact</artifactId>
  <version>1.0</version>
</dependency>

find all classes that uses it (such as):

import org.company.similarprojectnamebutnotquitethesame.packagecontinued.SomeClass

TLDR: Is there an efficient way to locate all files in my project that use a given dependency?

1 Answers
Related