Question

I want to install SWTBot into Eclipse from their update site. I installed it manually via the UI and it worked. The link I used for repository is: http://download.eclipse.org/technology/swtbot/releases/latest/

Now I am trying to install SWTBot using command line. I found the following command:

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

This works if I provide all feature IDs of SWTBot. My question is how to install all features in that update site without having to providing all feature IDs one by one?

I tried omitting the -installIU option, but this doesn't work.

Was it helpful?

Solution 2

AFAIK there is no universal kosher way of doing that since a P2 repository (what you call "update site") may contain different types of artifacts which are not necessarily grouped together in a consistent way.

@oberlies' suggestion should work, you just need to find the proper syntax for that.

However I am not quite sure it's a good idea to blindly install everything you have in the repo.

The SWT bot repo contains only 5 categorized features, so IMHO there is no need for any scripts, just check which of the features you really need, since there are just few of them.

Repo categories

OTHER TIPS

You can use the director application to run queries on the installable units available in repositories. With the following command, you'll get a list of all features in a repository:

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)\"))"

You could cleansing the output of that command and pass it into your director call as -installIU parameter. This would allow you to install all features from a repository.

Related question: Command line to find units in a p2 repository using p2 query languange

Using Nodecipse CLI Installer

npm install nodeclipse -g

then

nodeclipse install all from <repositoryURL>

check

>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.

As of 0.10.8 version, I noticed that p2 director cannot update when there are dependencies between features (Eclipse p2 director application cannot update a feature).
Also it cannot resolve to take missing IU from Eclipse main repository (as Eclipse GUI would do.)

@oberlies, I have tried using query, but it fail when using from 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

So just did filtering using JavaScript (.split, .filter).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top