0

I wanted to build java projects using eclipse command line tool. I have been following this answer. However, it doesn't talk about how to add projects to the newly created workspace via command line.

P.S. I am working on headless Linux box and hence I can't launch eclipse UI and add projects to the workspace from there.

Yogesh Badke
  • 4,249
  • 2
  • 15
  • 23
  • 1
    what about copying them to your workspace ? – Elarbi Mohamed Aymen Apr 19 '18 at 11:17
  • 2
    You can use gradle build tool to generate eclipse projects. But really, take one advice: do _not_ use eclipse for headless building, use gradle or maven, but do not use eclipse. Having migrated a project of about 300 OSGi modules from a headless PDE build to a gradle build I really know what I am talking about, be good to yourself and everybody on the project and drop the idea all together. – Oleg Sklyar Apr 19 '18 at 11:19
  • @OlegSklyar I think your comment should become the accepted answer! – Honza Zidek Apr 19 '18 at 11:27
  • @HonzaZidek I wish everybody would see it that way. But for all those who want to build an Eclipse RCP application with gradle here is the plugin I wrote for that 300-large OSGi/RCP project https://github.com/teris-io/nox Undocumented, but I will be happy to write basic docs if there is interest – Oleg Sklyar Apr 19 '18 at 11:36
  • @OlegSklyar I completely agree. However, this is a legacy project and can't be migrated to maven or gradle as of now. – Yogesh Badke Apr 19 '18 at 12:03
  • Add gradle and generate project files of your liking in just a few lines of code. – Oleg Sklyar Apr 19 '18 at 12:37
  • Got it, thanks for the direction. – Yogesh Badke Apr 19 '18 at 12:54
  • You could write an Eclipse Application that leverages the `org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob` (and perhaps make it usable in a headless environment) and contribute it as a patch to the `org.eclipse.ui.ide` owner plug-in. – nitind Apr 19 '18 at 21:59

0 Answers0