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 203623 - Maven project does not show generated test sources
Summary: Maven project does not show generated test sources
Status: RESOLVED DUPLICATE of bug 187595
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0.1
Hardware: PC All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-13 06:32 UTC by massimo
Modified: 2011-10-29 01:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
dummy maven project created with archetype (12.66 KB, application/x-zip-compressed)
2011-10-13 06:32 UTC, massimo
Details
screen shot of project view (91.00 KB, image/png)
2011-10-13 06:33 UTC, massimo
Details
screenshot of Files view (77.63 KB, image/png)
2011-10-13 06:34 UTC, massimo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description massimo 2011-10-13 06:32:09 UTC
Maven projects do not show test sources properly when you set them to be under the target directory.

I attached a maven project generated with the quick archetype and edited its pom with:
<testSourceDirectory>target/test/java</testSourceDirectory>
under build.
The line:
<testSourceDirectory>src/test/java</testSourceDirectory>
obviously works, as it is the default, and it also works if you pick any directory outside of target, like src/test1.
But when you try use something underneath ${project.build.directory} the project folder "Test Packages" will only show the default package, not the correct package (see attached image).
Was assuming similar functionality as with "generated-sources", like when you use JAXB, which is correctly recognized, but a directory like "target/generated-test-sources", which would seem analogous, does not work.

It is an annoying issue because many times, in order to make the build portable, you have to filter test sources in Maven so that the build gets the correct paths (from Maven properties such as ${project.basedir}) especially when you run integration tests.
Filtered sources would naturally go under target, but then, if they are not displayed correctly by the IDE, it makes it difficult to do things like debugging those  filtered sources.

Left the default issue type as defect, as generated-sources works very well, and you are brought to assume that a similar way were available for test sources, but of course, this issue can also be thought of as "enhancement".
Comment 1 massimo 2011-10-13 06:32:55 UTC
Created attachment 111970 [details]
dummy maven project created with archetype
Comment 2 massimo 2011-10-13 06:33:56 UTC
Created attachment 111971 [details]
screen shot of project view
Comment 3 massimo 2011-10-13 06:34:29 UTC
Created attachment 111972 [details]
screenshot of Files view
Comment 4 Jesse Glick 2011-10-29 01:16:08 UTC
Already works in NB 7.1.

*** This bug has been marked as a duplicate of bug 187595 ***