Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 IntelliJ IDE 开发一个插件,我想显示属于当前项目的依赖项。有没有办法通过 IntelliJ open api 获取依赖项列表?
对于项目中的每个模块,您可以使用它ModuleRootManager来获取依赖项:
ModuleRootManager
// get the modules on which it depends ModuleRootManager.getInstance(module).getDependencies() // get the libraries on which it depends ModuleRootManager.getInstance(module).getModifiableModel().getModuleLibraryTable()