Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 93866

Summary: support for hierarchical project structures
Product: [Eclipse Project] Platform Reporter: Brett Porter <brett>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: john.arthorne
Version: 3.0.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Brett Porter CLA 2005-05-05 21:02:52 EDT
This may be related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=75832, but
I didn't completely understand the report. I was surprised not to find this
already as I thought it was a frequently requested feature.

I have a project structure in Java that has a number of subprojects. Each of the
subprojects produces distinct JARs, so must remain as projects in Eclipse.
However, the top level includes shared documentation, build files and in some
cases is used to aggregate information from the subprojects.

However, because the projects can't overlap in Eclipse, I'm left with either the
option to not have Eclipse manage that content, hand editing and committing the
files in there, or to create another simple project for it and move it into a
subdirectory. The latter makes it less intuitive for others checking out the
project and introduces a project into the workspace that doesn't really do
anything - it just holds content.

I'd like to be able to manage a project hierarchy, where a project can contain
subprojects, and content in the top level is accessible to the editor and VCS.
Comment 1 John Arthorne CLA 2005-05-06 09:52:46 EDT
This is what multiple source folders are designed for.  From the project
properties dialog, go to the Java Build Path section, on the Source tab.  From
there you can set up multiple source folders within the same project, each
having distinct output folders for the class files if desired.  You can also
have other top-level folders on the project for documentation, etc.
Comment 2 Brett Porter CLA 2005-05-06 10:14:19 EDT
thanks for responding so quickly. However, what I'm asking is subtly but
importantly different - basically "Each of the subprojects produces distinct
JARs, so must remain as projects in Eclipse.", but I'll explain more.

It is desirable for each of these separate projects to have their own list of
libraries, and I would like to clearly define their interdependencies among each
other. By using multiple source folders, even with different outputs, everything
effectively depends on everything else, and on every library. While this
shouldn't cause a problem, the separation would make it easier to retain the
designed separations.

In addition, I know of projects where there are two versions of a particular
project with identical classes where they are built to target different JDK or
dependency versions (eg an implementation of something that users servletapi 2.3
and another using 2.4). I'm assuming these would have to be in separate folders,
which would preclude them from being in the same tree.
Comment 3 John Arthorne CLA 2005-05-06 10:23:36 EDT
Ok, your assertion that building to separate JARs as a reason threw me off -
there is no reason why each source folder couldn't produce a distinct JAR. 
However, if you need distinct classpaths or different JREs, then you're stuck
with multiple projects.  I'm marking this as a duplicate of a similar request.

*** This bug has been marked as a duplicate of 35973 ***