Thomas Uhrig
Thomas Uhrig

Reputation: 31605

Set up Eclipse workspace automatically (import projects, target platform and preferences)

I'm trying to set up an Eclipse workspace automatically. So far, I managed to import projects automatically using the Eclipse CDT project and the following command:

eclipsec.exe -nosplash -data workspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll C:\project

After that command, I can start Eclipse and all projects in C:\project are imported to my workspace.

But how can I import a target platform automatically? And how can I import Eclipse preferences automatically?

I'm unable to find a documentation about the command line arguments of Eclipse CDT. And I it feels strange to install a complete C/C++ tool chain just to import projects (of a Java project). Are there any alternatives?

Thanks and best regards, Thomas

Upvotes: 4

Views: 3653

Answers (2)

Jörg
Jörg

Reputation: 958

There is a solution called oasp4j-ide available. With this you can have a template workspace with all your preferred settings. This can be used to setup an initial workspace as well as to update existing workspaces and merge the settings without interfering unmanaged user specific settings.

https://github.com/oasp/oasp4j-ide/wiki/features

Upvotes: 1

Don Kartacs
Don Kartacs

Reputation: 426

(I think your question is as old as the universe itself and the answer is at least 10 times more bogous :))

Short Answer: Copy your .metadata folder to the new workspace folder and re-import the necessary projects.

Why: We have to "clone" and start a new workspace quite often. And I'm pretty sure one of our fellow stackoverflower will suggest you exporting your preferences (which can be done under File/Expert-> type pref and it will be there) However you will soon realize it will not export a whole lot of things. For example projects often times lose their checkstyle prefs or exluded folder prefs. Also prefs like external java compiler or maven repo directory will be lost, not to mention window settings, and so on... the list is long. But when you copy the whole .metadata directory you keep all that.

Its quite a "barbaric" approach but not failed me yet.

Upvotes: 2

Related Questions