Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 167572 - NetBeans doesn't recognize custom generated source directories outside of project directory.
NetBeans doesn't recognize custom generated source directories outside of pro...
Status: VERIFIED FIXED
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Milos Kleint
issues@platform
67patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-24 07:42 UTC by massimoh
Modified: 2009-07-20 14:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Simple Maven NetBeans project that easily reproduces issue (1.47 KB, application/x-compressed)
2009-06-24 07:43 UTC, massimoh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description massimoh 2009-06-24 07:42:21 UTC
If I use build-helper-maven-plugin to specify a custom source path like:
<source>${project.basedir}/../customsourcefolder</source>

NetBeans doesn't recognize the source code within. If I move the source directory into ${project.basedir} and update the 
custom source path to:
<source>${project.basedir}/customsourcefolder</source>

NetBeans properly recognizes the source code.

NetBeans 6.7 RC3
Windows Server 2008 x64
JDK 1.6.0_14 x64
Comment 1 massimoh 2009-06-24 07:43:22 UTC
Created attachment 83977 [details]
Simple Maven NetBeans project that easily reproduces issue
Comment 2 Milos Kleint 2009-06-24 09:59:57 UTC
http://hg.netbeans.org/main/rev/8adcb69831ae

the problem is with "generated" source roots (as the project is using the build helper plugin configuration) and not the
<build><sourceDirectory> element in the pom. That one is primarily meant to be used by tools generating sources, I don't
see a reason why one should generate sources *outside* of the target/ folder of the project, so you seem to be using it
to define multiple source roots for the project which is not a recommended practice in general.

the changeset fixes it, by checking the generated source roots for location in or outside of the project root. Please
note that in general source roots outside of the project root are considered a corner case and only partially supported
(eg. if you change the outside location while the project is opened, you will have to close/reopen the project to have
the IDE to notice etc).
Comment 3 massimoh 2009-06-24 16:51:47 UTC
Thanks so much!

I am working with a large legacy project and I don't have authority to reorganize directories.

- There are multiple source roots (human written, non-generated code)
- The pom.xml should not be in the root directory.

I understand that this structure breaks recommended practice (I wouldn't have organized this way).

The corner case limitation sounds quite acceptable for this purpose. Thanks again
Comment 4 Quality Engineering 2009-06-24 20:35:11 UTC
Integrated into 'main-golden', will be available in build *200906241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8adcb69831ae
User: Milos Kleint <mkleint@netbeans.org>
Log: #167572 include generated sources in the list of urls that get checked and registered as external source roots.
Comment 5 massimoh 2009-07-09 19:52:29 UTC
This problem is still present in NetBeans 6.7 final with the same test project.

This fix was checked in before 6.7 final. Am I misunderstanding the fix or did this somehow not get included?
Comment 6 Milos Kleint 2009-07-09 19:58:15 UTC
the target milestone is set to 6.8 which means it's fixed in trunk (future 6.8 version) it was too late to fix at RC times..
I've addded the 67patch-candidate tag to eventually include it in the 6.7.1 patch release..
Comment 7 Jaroslav Pospisil 2009-07-13 09:11:25 UTC
v.
Comment 8 pgebauer 2009-07-13 17:08:33 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/6fdec3b703d3


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo