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 54429

Summary: If no src/ subdir, project root should be default source root
Product: java Reporter: _ tboudreau <tboudreau>
Component: FreeformAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: blocker CC: jchalupa, jglick, jrojcek, mkubec
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ tboudreau 2005-02-03 04:04:06 UTC
It's pretty common for projects to set their source root as the 
project root (e.g. jnn.dev.java.net).  It would be a good idea to use 
this as the default, if the user specifies nothing else for a project 
with an existing ant script (actually best would be analyzing any 
compile targets in the existing ant script).
Comment 1 Jesse Glick 2005-03-10 00:08:36 UTC
The user has to explicitly pick valid source roots. Trying to be too magical
will just make things worse.

Already considered future enhancements:

- scanning around for *.java files, sniffing package decls, trying to guess
[easy-to-moderate]

- looking for <javac> tasks and figuring out what they are doing [difficult]
Comment 2 _ tboudreau 2005-03-10 04:14:35 UTC
The thing that sucks is the number of clicks required - that's what I really want to solve.  If the source root 
is the project dir, you open the file chooser, it's open on the source root, which means you have to back 
up a directory and then point at it.

Simple workaround that will catch 90% of the cases and not be too magical:  If the project root has 
directories named "com", "org" or "net" assume it is the source root.  The user still has a chance to correct 
it if it's wrong.

Reopening because I think that would probably solve most cases, and would take about 5 minutes to 
implement;  close if you strongly disagree.
Comment 3 Jesse Glick 2005-03-10 16:25:19 UTC
Can be considered (not for E): if $prjdir (or perhaps also first- and
second-level subdirectories?) contains any subdir with the name 'org', 'net',
'com', or 'edu', prepopulate that dir in the Source Roots panel of the new
project wizard, for the user to confirm or modify as now. If doing subdirs
besides $prjdir itself, should add it as a test root if dir name matches
/.*test.*/, I suppose.
Comment 4 _ tboudreau 2005-03-10 17:50:22 UTC
Would like it if you'd consider only the simplified thing I suggested for E:  just scan $prjroot for 
com,edu,net,org and if so, put $prjdir in as the source root.  Should be about 4 lines of code, extremely 
low risk.

The reason is:  A *lot* of projects out there are organized this way.  It's *much* better user experience if 
the new project wizard actually finds everything - when it does that, it makes a very good first impression;  
the IDE looks slightly dimwitted if it's pointed right at the source root but somehow can't figure out that's 
what it's looking at.  Anybody switching to NetBeans probably has existing projects, and the more 
everything "just works" the more likely they are to keep using it.  This is a place where a very simple 
change would make a difference in one of the first things a new user is going to encounter.
Comment 5 Jesse Glick 2005-03-10 20:13:46 UTC
Honzo, any objections to doing the simple version of this for E? Should be very
low risk.
Comment 6 Jan Chalupa 2005-03-10 20:27:42 UTC
No objection from me. Sounds reasonable if it can make lives of new users easier.

Cc'ing Milan, to give QA a chance to comment.
Comment 7 Antonin Nebuzelsky 2010-01-11 04:28:38 UTC
Changing the default component owner to tzezula.