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.

Bug 149885 - Automatic projects block creation of freeform projects
Summary: Automatic projects block creation of freeform projects
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-12 12:11 UTC by Jan Lahoda
Modified: 2016-07-07 07:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2008-10-12 12:11:44 UTC
[recent trunk build with Automatic projects from the Development AUC, NB6.5beta+Automatic projects from the
pre-installed AUC]

It is not possible to create a freeform project (based on build.xml) when the Automatic projects are installed. The new
freeform project wizard warns the user that "Project folder is already owned by NetBeans project <foo>".
Comment 1 Jesse Glick 2008-10-15 21:13:45 UTC
This should be a warning, not an error, unless there is an actual nbproject dir.
Comment 2 Milan Kubec 2008-10-16 07:46:29 UTC
OK, but if it's only warning then we allow to create two projects over one folder in fact. Automatically created AP and user created Freeform project? IMO as 
far as we want to have AP and Freeform projects supported in one build user must say which project will be actually created for given project folder, can't be 
both.
Comment 3 Jan Lahoda 2008-10-16 20:18:01 UTC
Sorry, but I do not agree with the "just a warning" solution, for several reasons:
-AFAICT, there is no guarantee that (after the New Project wizard is finished), the freeform project would take
ownership over the project dir. So, the autoproject might  be opened at the end of the wizard, causing confusion.
-as Milan points out, the New Project wizard would allow to create new projects for source roots of existing projects,
which does not seem right to me.

I am also not sure what you mean by "unless there is an actual nbproject dir" - AFAIK the NB projects are not required
to have nbproject directory, so checking for the nbproject directory seems quite unreliable for me.
Comment 4 Jesse Glick 2008-10-17 19:09:05 UTC
If the freeform project is to place an nbproject dir directly beneath the main project dir, then it can go ahead and do
so if there is no existing nbproject dir. Ant-based project types always take precedence over autoprojects. We might
need a new API call in ProjectManager to force the project dir to be rerecognized during the current IDE session
(otherwise a restart could be required).

If the freeform project is to claim external source roots which happen to be beneath a dir with a build.xml, it can also
go ahead and do so; the use of FileOwnerQuery.markExternalRoot will cause that root to be owned by the freeform project
(and this information is now also persisted across IDE sessions, so Java scanning should work later even if the freeform
project is not open).

In both cases, a warning but not an error seems appropriate. Again please note that this has nothing to do with
autoprojects in particular; the exact same considerations would apply to a directory that happened to contain a pom.xml
that the user has no interest in, etc.
Comment 5 Jan Lahoda 2008-10-21 13:24:13 UTC
Well, I still think that changing the current error to warning is opening of Pandora's box. I can imagine quite a few
(unsolvable) problems that the users may encounter caused by one project created over another project. Moreover, whether
a project will be able to "steal" project directory from another project depends on the order of ProjectFactories, which
will be confusing for the user. E.g. it should be possible to create a freeform project from an autoproject, but it is
not possible (I think) to create an autoproject from freeform project? Quite confusing, IMO.

The external source roots make it even worse, IMO. The current support for external support is not perfect, but if we
allow "stealing" source roots between projects, the resulting behavior will be unpredictable, I think.
Comment 6 Lukas Hasik 2008-10-24 10:43:30 UTC
automatic project aren't related to 6.5, right?
Comment 7 Jesse Glick 2008-10-24 18:38:49 UTC
AP is available as a beta download for 6.5 but is not part of the official product. In the short term I may need to do
some workaround in AP for problems in the wizards of other project types, such as making the autodetection of folders
containing build.xml as a project optional.
Comment 8 Jesse Glick 2008-11-07 02:32:14 UTC
In the future the automatic project wizard will probably offer an option to convert a freeform project (i.e. delete
nbproject/).

Ownership of external source roots (which are subdirs of the potential project dirs) is not dependent on order of
project factories; FOQ pays attention first to marked external roots, and only second to project factories on parent dirs.
Comment 9 Jesse Glick 2008-11-14 17:11:32 UTC
For the updated 6.5 version, autodetection of folders containing build.xml as autoprojects is off by default but can be
enabled if desired. This at least should make the bug in the freeform wizard less likely to be encountered.
Comment 10 Jesse Glick 2009-10-21 23:23:28 UTC
See last comment for justification for lowered priority. See also issue #150561.
Comment 11 Antonin Nebuzelsky 2010-01-11 04:29:19 UTC
Changing the default component owner to tzezula.
Comment 12 Martin Balin 2016-07-07 07:15:42 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss