Rustam Issabekov
Rustam Issabekov

Reputation: 3517

Intellij IDEA - how to find package usage in a project

I am looking at a project's maven pom file with a lot of dependencies and trying to find out if a particular dependency is used or not. Is there a way in Intellij IDEA to find all import statements that import any class from a particular package?

Upvotes: 3

Views: 3118

Answers (2)

JimHawkins
JimHawkins

Reputation: 4994

I'm working with IntelliJ IDEA 14 UE.

  1. switch to the view "Project"
  2. in the tree view, go to the node "External Libraries"
  3. search the particular library (=dependency) and open the node
  4. select a package within this library
  5. in the popup menu of this package, click "Find usages". Alternatively, press Alt+F7 (Windows)

Upvotes: 5

maba
maba

Reputation: 48105

I am not aware of a way to do it directly in IntelliJ but you can always use the analyse goal of the maven-dependency-plugin.

Here is a link to a nice example of the plugin.

Upvotes: 1

Related Questions