10

Sherlog is an OSGi-based log analyzer, if I import this project as an workspace snapshot I receive lot's of projects in my workspace, but I would prefere to have them as subprojects in a project.

The other option would be to checkout from svn, but then I face other problems (I don't know how to setup the dependencies for automatically build)

Does anyone have an idea or good links on this topic? Thanks

stacker
  • 68,052
  • 28
  • 140
  • 210

2 Answers2

15

EDIT: For Eclipse 4.5 and newer please see https://stackoverflow.com/a/34134833/53897


Eclipse does not support subprojects. The Eclipse way of life is one or more projects in a workspace (perhaps using work sets to avoid seeing them all).

As a consequence we have established an approach where we switch workspaces when switching projects. Team Projects are nice for this for CVS. For git I do a separate clone for each workspace as the Maven support in Eclipse does not pick up changes in the pom hierarchy (like a new project) easily.

Community
  • 1
  • 1
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • +1 Thanks, this project already uses Team Project Set Files. These are the keywords to I've to google – stacker Apr 11 '10 at 11:37
  • Since Eclipse 4.5/Mars, this answer is out-of-date, because Eclipse supports nested project view: https://www.eclipse.org/eclipse/news/4.5/M5/#nested-projects – Mickael Dec 14 '15 at 12:52
  • Great - glad to hear that this has gotten better in the 5.5 years that has passed since I originally answered the question. Actually I thought that Eclipse has but in name entered maintenance mode. – Thorbjørn Ravn Andersen Dec 14 '15 at 15:02
  • @Mickael instead of commenting and downvoting you should consider writing a better and more up-to-date answer. – Thorbjørn Ravn Andersen Dec 14 '15 at 15:07
  • @Thorbjørn: It would be more efficient if you update your answer, and I'll vote it up. SO readers tend to read only the highest ranked answer marked as resolved (fair enough). Unfortunately, writing new answers on that thread wouldn't make readers read it. – Mickael Dec 14 '15 at 17:15
  • @Thorbjørn: I know it's not how SO is intended to work, but it's how I've seen user using it. And I care more about users than about SO principles ;) Thanks for your edit anyway! – Mickael Dec 15 '15 at 05:57
  • @Mickael I think you should bring that up on meta then. – Thorbjørn Ravn Andersen Dec 17 '15 at 04:03
3

As of Eclipse 4.5 (starting from Mars M5) subprojects are supported. Either import a multi module maven project like here.

Or create a directory structure like this.

BaseProj
----.project
----JavaSubProject1
--------.project
--------.classpath
--------src
--------JavaSubProject2
------------.project
------------.classpath
------------src

Use 'File->Import->Existing Projects into Workspace' and import only BaseProj. It will import all projects. Be sure to activate hierarhical view in Project Explorer.

Later edit - When using import dialog, check 'Search for nested projects' otherwise only BaseProj will be created.

gliviu
  • 81
  • 4
  • I would like this to prevent ex.: sub-project1 from having access to sub-project2, but sub-project2 can see everything from sub-project1, is it possible? also, last time I tried eclipseMars it was so glitchy that I was forced back into eclipseLuna; should I try eclipseNeon or it is too risky? :) – Aquarius Power Sep 17 '16 at 06:59