【问题标题】:How to install all features from a p2 update site to an Eclipse using the command line?如何使用命令行将所有功能从 p2 更新站点安装到 Eclipse?
【发布时间】:2014-02-20 11:28:31
【问题描述】:

我想从他们的更新站点将 SWTBot 安装到 Eclipse 中。我通过 UI 手动安装它并且它工作。我用于存储库的链接是:http://download.eclipse.org/technology/swtbot/releases/latest/

现在我正在尝试使用命令行安装 SWTBot。我找到了以下命令:

eclipse.exe -application org.eclipse.equinox.p2.director \
    -repository http://download.eclipse.org/technology/swtbot/releases/latest/ \
    -installIU <feature IDs>

如果我提供 SWTBot 的所有功能 ID,这将有效。我的问题是如何在该更新站点中安装所有功能,而不必一一提供所有功能 ID?

我尝试省略 -installIU 选项,但这不起作用。

【问题讨论】:

    标签: java eclipse p2 swtbot


    【解决方案1】:

    您可以使用 director 应用程序对存储库中可用的可安装单元运行查询。使用以下命令,您将获得存储库中所有功能的列表:

    eclipsec.exe -application org.eclipse.equinox.p2.director \
       -repository <URL of some repository> \
       -list "Q:everything.select(x | x.properties ~= filter(\"(org.eclipse.equinox.p2.type.group=true)\"))"
    

    您可以清理该命令的输出并将其作为-installIU 参数传递给您的director 调用。这将允许您从存储库安装所有功能。

    相关问题:Command line to find units in a p2 repository using p2 query languange

    【讨论】:

    • 我不明白,我必须把这个放在哪里?导演应用程序有 UI 吗?
    【解决方案2】:

    AFAIK 没有通用的犹太洁食方法,因为 P2 存储库(您称之为“更新站点”)可能包含不同类型的工件,这些工件不一定以一致的方式组合在一起。

    @oberlies 的建议应该可行,您只需要为此找到正确的语法。

    但是我不太确定盲目地安装你在 repo 中的所有东西是个好主意。

    SWT bot repo 仅包含 5 个分类功能,因此恕我直言,不需要任何脚本,只需检查您真正需要哪些功能,因为它们很少。

    【讨论】:

      【解决方案3】:

      使用Nodecipse CLI Installer

      npm install nodeclipse -g
      

      然后

      nodeclipse install all from <repositoryURL>
      

      检查

      >nodeclipse help install
      Nodeclipse CLI Installer (Eclipse Plugin Manager epm)
          nodeclipse help
          nodeclipse help aliases
        Usage (from folder with eclipse):
          nodeclipse list [repositoryURL]
            default repositoryURL is http://www.nodeclipse.org/updates/
            repositoryURL may be file e.g. jar:file:/D:/path/to/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/
          nodeclipse install <alias|exact.feature.name.feature.group> [...]
          nodeclipse install from repositoryURL <alias|exact.feature.name.feature.group> [...]
          nodeclipse install all from repositoryURL // BE CAREFUL WHAT YOU ASK FOR
        Mapped aliases(21): egit git gfm gradle hudson icons jjs markdown maven mongodb mongodb.shell moonrise nodejs phantomjs pluginslist restclient shelled startexplorer themes wikitext yaml
      
        Visit http://www.nodeclipse.org/ for News, post Shares, Installing details, Features list, Usage (incl Video, Demo) with all shortcuts, Help and Hints, Support options, Where Helping needed, How to
      thank and Contact us, also History page.
      

      从 0.10.8 版本开始,我注意到当功能之间存在依赖关系时 p2 director 无法更新 (Eclipse p2 director application cannot update a feature)。
      它也无法解决从 Eclipse 主存储库中获取丢失的 IU(就像 Eclipse GUI 那样。)

      @oberlies,我尝试过使用查询,但从 JavaScript 使用时失败:

      //var query = '"Q:everything.select(x | x.properties ~= filter(\"(org.eclipse.equinox.p2.type.group=true)\"))"';
      //var query = '"Q:everything.select(x | x.properties ~= filter(\\\"(org.eclipse.equinox.p2.type.group=true)\\\"))"';
      var query = ''; //both option fails with Node
      

      所以刚刚使用 JavaScript 进行过滤(.split.filter)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-07-22
        相关资源
        最近更新 更多