【问题标题】:How to get the list of dependencies via IntelliJ open api如何通过 IntelliJ open api 获取依赖列表
【发布时间】:2016-10-17 14:10:18
【问题描述】:

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

【问题讨论】:

    标签: java plugins intellij-idea intellij-plugin openapi


    【解决方案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()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-27
      • 2023-04-05
      • 1970-01-01
      • 2015-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多