cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 149885 - Automatic projects block creation of freeform projects
: Automatic projects block creation of freeform projects
Status: NEW
: java
Freeform
: 6.5
: All All
: P4 (vote)
: 6.9
Assigned To:
:
:
: autoproject
: NO68
:
:
  Show dependency treegraph
 
Reported: 2008-10-12 12:11 by
Modified: 2009-10-21 23:23 (History)
Issue Type: DEFECT
:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-10-12 12:11:44
[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 From 2008-10-15 21:13:45 -------
This should be a warning, not an error, unless there is an actual nbproject
dir.
------- Comment #2 From 2008-10-16 07:46:29 -------
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 From 2008-10-16 20:18:01 -------
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 From 2008-10-17 19:09:05 -------
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 From 2008-10-21 13:24:13 -------
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 From 2008-10-24 10:43:30 -------
automatic project aren't related to 6.5, right?
------- Comment #7 From 2008-10-24 18:38:49 -------
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 From 2008-11-07 02:32:14 -------
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 From 2008-11-14 17:11:32 -------
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 From 2009-10-21 23:23:28 -------
See last comment for justification for lowered priority. See also issue
#150561.