1

我正在为 IntelliJ IDE 开发一个插件,我想显示属于当前项目的依赖项。有没有办法通过 IntelliJ open api 获取依赖项列表?

4

1 回答 1

1

对于项目中的每个模块,您可以使用它ModuleRootManager来获取依赖项:

// get the modules on which it depends
ModuleRootManager.getInstance(module).getDependencies()

// get the libraries on which it depends
ModuleRootManager.getInstance(module).getModifiableModel().getModuleLibraryTable()
于 2016-06-16T09:18:40.877 回答