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

Bug 202483

Summary: Sub Projects
Product: [WebTools] WTP Java EE Tools Reporter: Brian Dillon <brian.dillon>
Component: jst.j2eeAssignee: Chuck Bridgham <cbridgha>
Status: CLOSED DUPLICATE QA Contact: Chuck Bridgham <cbridgha>
Severity: enhancement    
Priority: P3 CC: bokowski, kaloyan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: ProjectStructure

Description Brian Dillon CLA 2007-09-06 11:45:25 EDT
Build ID: I20070621-1340

Steps To Reproduce:
We are using the Eclipse WTP and are looking at potential project structures
for new projects. We want to take advantage of the auto-loading of classes
and JSPs etc so have initially opted to use the Dynamic Web Project
structure. However a further requirement we have is the ability to partition
our projects into sub projects. For Example;

ProjectA has two partitions ProjC and ProjD.

What we want to achieve is for ProjectA to work as a Dynamic Web Project
(with auto loading) where the classes and JSPs are taken from ProjC and
ProjD. That way a change in ProjC would automatically be reflected in
ProjectA's running Web App.

The reasoning behind wanting separate eclipse projects is that we may also
have another Web Project ProjectC which only makes use of partition ProjC.


More information:
Comment 1 Boris Bokowski CLA 2007-09-06 16:17:50 EDT
Moving to Web Tools for comment - can you solve this by referencing ProjC and ProjD from ProjA?

Note that Eclipse does not support nesting of projects, but projects may reference other projects to have them included in the build etc., and supports linked folders to have the same files appear in multiple projects. See bug 43536.
Comment 2 Chuck Bridgham CLA 2007-09-11 09:45:01 EDT
We can't support nested projects.   But better support for aggregation of multiple project folders could be easier....  Set to enhancement
Comment 3 Brian Dillon CLA 2007-09-11 10:09:52 EDT
Hi,

If sub-projects can't be added is there some way of creating compile depdencies so that changes in one project (ProjC) are reflected in the running app of another (ProjectA). As I can see there are currently two possible workarounds;

Option 1:

* Use a Single Project with Sub directories i.e.

ProjectA
/
+- src/
|  +- ProjC/
|  |  +- src/
|  |  |  +- ...
|  |  +- resources/
|  |     +- ...
|  |  +- webapp/
|  |     +- ...
|  +- ProjD/
|  |  +- src/
........

* Update ProjectA build path to inlcude source folders "ProjC/src" and "ProjD/src"
* Update the eclipse config file "org.eclipse.wst.common.component" to include the source;
    <wb-resource deploy-path="/WEB-INF/classes" source-path="/ ProjC/src"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="/ ProjD/src"/>

* Update the eclipse config file "org.eclipse.wst.common.component" to include the JSPs/XHTML

    <wb-resource deploy-path="/" source-path="/projC/webapp"/>
    <wb-resource deploy-path="/" source-path="/projD/webapp"/>

Issues:
1. Everything is contained within a single project => no real partitioning.
2. The config file "org.eclipse.wst.common.component" must be manually edited
 

Option 2:

Using 3 Separate Eclipse Projects: ProjectA, ProjC and ProjD

* Define path variables to point to ProjC and ProjD
* Link the source for ProjC and ProjD in ProjectA
* Create new 'link folders' for ProjC and ProjD resouces and JSP/XHTML
* Update the eclipse config file "org.eclipse.wst.common.component" to include the appropriate source and JSPs/XHTML

Issues:
1. The source and resources must be linked separately to the 'main' project.
2. The config file "org.eclipse.wst.common.component" must be manually edited



Is there a recommended workaround ? What would be nice is some way of pointing to a 'dependant' project to get the source/rsource/JSP links set up similar to Option 2 above.

Thanks,

Brian
Comment 4 Kaloyan Raev CLA 2008-09-01 11:57:03 EDT
Assigning to Chuck for evaluation
Comment 5 Chuck Bridgham CLA 2010-02-15 10:47:17 EST
Setting to duplicate of the long running enhancement of logical nested projects from the platform

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