5

Maven allows parent-child relationship between projects. By default, parent project is expected locating in parent folder.

Is it possible to adopt this structure to Eclipse?

Currently I have imported all folders separately as project with sources without copying and consequently have separate nodes for each project in Package Explorer.

Unfortunately it causes various glitches including EGit functionning.

Dims
  • 47,675
  • 117
  • 331
  • 600

3 Answers3

5

Eclipse 4.5 (starting from Mars M5) will include a mechanism that allows to nested projects under their parent one. You can already give it a try by accessing the latest snapshot build of Eclipse Platform (which is a subset of the IDE, but which contains the change) http://download.eclipse.org/eclipse/downloads/drops4/N20150124-1500/ , when Mars M5 is ready, you'll be able to access from http://eclipse.org/downloads a full featured IDE which also contains this feature.

Reference https://bugs.eclipse.org/bugs/show_bug.cgi?id=427768

Mickael
  • 3,506
  • 1
  • 21
  • 33
  • Sadly, this only seems to work in the Project Explorer view, and does not seem to work in the Package Explorer view. – Scott Carey Jun 12 '15 at 23:09
  • Indeed, the package explorer doesn't provide efficient extension mechanism, and is somehow a legacy view that would rather be removed, so the hierarchical view of projects wasn't implemented for it. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=427897 – Mickael Jun 13 '15 at 09:04
  • but is there an maven support for that ? Can I import an big hierarchy of maven projects as one .. and eclipse to find out ou there are 50 child projects here and there let me fix and import them as well and show them nicely like in Idea ? – jNayden Nov 11 '15 at 10:01
  • @JOKe To import all Maven modules at once, look at the answer from nicola-musatti below. There's also an ongoing work about a single unified import strategy in Eclipse IDE, which is already working great for Maven project, but it requires to install additional stuff: https://wiki.eclipse.org/E4/UI/Smart_Import . You can install the pieces linked in that page separately, or install direclty JBoss Tools from Eclipse Marketplace which bundles them all. – Mickael Nov 12 '15 at 06:32
2

Check this answer. Eclipse Workspace Plugin manages the resources in this hierarchy(or structure) and also exposes the APIs to handles these resources programmatically in the similar way.

All projects inside eclipse are identified by the presence of .project file inside the project folder. Refer this answer

Community
  • 1
  • 1
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
1

If you already store your projects as Maven expects them, i.e. the aggregator project in the top level directory and all its modules each in its own direct subdirectory you should be able to view modules as full fledged Eclipse projects by running import -> Maven -> Existing Maven projects and then selecting the aggregator project's directory.

If this is not your structure it's more complicated if not impossible. With Subversion you can use externals to "hook" sub-projects to their aggregator, but I don't know if git supports a similar mechanism.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55