This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "Multiple projects per root" use case is broken | ||
---|---|---|---|
Product: | java | Reporter: | kirillkh <kirillkh> |
Component: | Project | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED WORKSFORME | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 98270 | ||
Bug Blocks: | 49026 | ||
Attachments: |
watches2
Toy sample of two projects sharing a root, with one common package |
Description
kirillkh
2007-03-04 12:28:16 UTC
Not sure if we should support it. Reassigning to Jesse. I will try to enable the wizard to permit this, so long as the state after the wizard is run proves to be usable. But it is not a principal use case. Thanks, Jesse. Includes/excludes is a cool feature even without the possibility to have several projects per source root, but having it would definitely make my life easier. My use case is one big source tree with most of the sources comprising a web application, another large part - a client application (considerable part of classes is shared with the web app), and in addition there are several smaller executable applications (utilities). Would be great, if I could separate all this mess into nice isolated projects. BTW, currently there's no support for includes/excludes in web projects, should I file another bug on that? An update: today I have been testing nonoverlapping projects pointing into the same (external) source root and so far it seems to work fine. I had the project metadata (project.xml etc.) set up by hand - currently the wizard will not let you do it. You could set it up in the GUI if you closed one project (and maybe restarted the IDE) before making the next one, I think, but it is cumbersome. Please note that all the projects must use the same classpath settings or behavior may be erratic (this is not yet detected as an error condition). For incl/excl support in web projects, by all means file a FEATURE request, as I don't think there is anything filed yet. Just make it block #49026 for tracking purposes and put me on CC. Created attachment 40238 [details]
watches2
Sorry, attached to the wrong issue :) *** Issue 119578 has been marked as a duplicate of this issue. *** Created attachment 51818 [details]
Toy sample of two projects sharing a root, with one common package
I did not get such an error when I set up such a project pair in 071026 - I think because I used specific includes such as "a/ b/" rather than including everything by default and excluding some things, meaning the source root dir itself is not considered owned by any project (assuming you use separate project directories none of which are a parent of the source directory). Even if you do run into this error, it should suffice to close the first project and restart the IDE before creating the second project (after that you can reopen the first one if you want). Some caveats: 1. If you are sharing some common packages, they will be reported as owned by one of the projects arbitrarily, depending on what projects have been opened and in what order. So e.g. F9 will build to the owner project's dir. If you want to compile to another project's output directory it is best to run Build from that project's context menu. 2. All the projects must share the same classpath or behavior may be erratic. 3. If there is no defined owner for the source root (as in the attached example), the IDE will quietly assume a classpath which is a merge of those of all _opened_ projects, which is not as precise as in the usual case. (Could include more or fewer entries than it ought to.) Assuming you have the project you are working on open, you will probably be OK; Ant compilation will catch any mistakes. If this becomes a problem, a workaround is to pick one or more of the projects and set its includes to "**" and excludes to whatever is needed to give it the desired contents. Sharing a source root across projects should not be considered fully supported, but it may work to a limited extent in NB 6 if you follow these guidelines. |