How to import multiple projects into Eclipse using command line?

eclipse, eclipse-cdt, import

Solution

The only documentation of `headlessbuild` I've found so far is the source. This reveals that the argument to `-importAll` should be the path to a directory containing all your projects. You can use -importAll repeatedly to import multiple trees of projects.

e.g. if you have the structure

tree/
  core/
    alpha/
      .project
    beta/
      .project
  edge/
    one/
      .project
    two/
      .project

Then this will build the four projects in a workspace `tree/workspace`:

cd tree
eclipse -nosplash -data workspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll core -importAll edge -build

On Windows, use `eclipsec.exe`.

Problem

Is there anyway that I can use command line to import multiple projects into Eclipse workspace all at once? I noticed that someone suggests using command line as follows: eclipse -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll {[uri:/]/path/to/project} But I cannot figure out the {[uri:/]/path/to/project} part correctly. Any example? Also, is the above command line the only way I can achieve this? (it seems like to depend on CDT?) Is there any other way I can do this in command line? Thank you!

Original source