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!
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
.
The Eclipse CDT provides tools to import projects via the command line. You can use the following command / options to do so.
eclipse -nosplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/]/path/to/project}
-importAll {[uri:/]/path/to/projectTreeURI} Import all projects under URI
-build {project_name | all}
-cleanBuild {project_name | all}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With