简体   繁体   English

Intellij IDEA-如何在项目中查找软件包使用情况

[英]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. 我正在查看具有很多依赖项的项目的maven pom文件,并试图找出是否使用了特定的依赖项。 Is there a way in Intellij IDEA to find all import statements that import any class from a particular package? Intellij IDEA中是否可以找到从特定包中导入任何类的所有导入语句?

I'm working with IntelliJ IDEA 14 UE. 我正在使用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) 或者,按Alt + F7键(Windows)

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 . 我不知道直接在IntelliJ中执行此操作的方法,但是您始终可以使用maven-dependency-pluginanalyse目标。

Here is a link to a nice example of the plugin. 这里是一个很好的插件示例的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM