8

Is it possible to access/manipulate an eclipse workspace via command-line?
I'm primarily asking about the workspace metadata rather than the files itself.

E.g. do things like

  • modify resource attributes (e.g. settings some resources to derived)
  • import existing projects
  • access markers
MRalwasser
  • 15,605
  • 15
  • 101
  • 147
  • This is a partial duplicate of http://stackoverflow.com/questions/1718456/create-an-eclipse-project-on-the-command-line (but note that it refers to Eclipse-CDT, that is C development, not Java). – Pino Mar 12 '13 at 16:45

3 Answers3

4

There are no command-line (headless) tools that I know of to perform these types of tasks. There are a few scripting projects for Eclipse out there that would provide a light-weight, scriptable interface to using the Eclipse API, however, none of them have command line available, I believe all of those scripting tools are UI based.

Another option would be to use Eclipse SDK to build an Eclipse application (headless app) that uses the Eclipse application model to perform the commands you wanted, but you would have to write the code yourself.

gamerson
  • 5,220
  • 1
  • 28
  • 45
1

Here is a list of eclipse command line options: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

Doesn't seem like there's one allowing to set the workspace, though...

Sebastian
  • 5,177
  • 4
  • 30
  • 47
-1

Eclipse is not designed to be used on the command line. If you want to work with the command line I would highly recommend to use a build manager like Apache Maven or Apache Ivy in your project. The advantage is that your build does not depend on Eclipse, you can switch the IDE if you want and you can build your projects and edit dependencies on the command line. Your project and its build/deployment should be independent of an specific IDE.

sglahn
  • 420
  • 3
  • 7
  • This does not answer the question. I need to manipulate eclipse workspace programmatically - this has nothing to do with building/build systems at all. – MRalwasser Mar 19 '13 at 16:17