如何使用命令行将p2更新站点中的所有功能安装到Eclipse?

时间:2013-10-29 06:46:51

标签: java eclipse p2 swtbot

我想从他们的更新站点将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选项,但这不起作用。

3 个答案:

答案 0 :(得分:3)

您可以使用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参数传递给导演调用。这将允许您从存储库安装所有功能。

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

答案 1 :(得分:0)

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

@oberlies'建议应该有效,你只需要找到适当的语法。

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

SWT机器人仓库只包含5个分类功能,因此恕我直言不需要任何脚本,只需检查您真正需要哪些功能,因为它们只有少数。

Repo categories

答案 2 :(得分:0)

使用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版开始,我注意到当功能之间存在依赖关系(Eclipse p2 director application cannot update a feature)时,p2导演无法更新。
此外,它无法解决从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)进行过滤。

相关问题