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.
To reproduce the defect in a maven project with generated sources: copy a pom.xml to the target (${project.build.directory}) directory, close the project and reopen the project, the generated sources are no longer recognized in the IDE (showing an empty <default package>.), which is problematic The cause of the problem seems to be org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation#getOwner not checking if the potential project directory is a build directory as indicated by the messages.log (showing the owner project to be the target/pom.xml) with option -J-Dorg.netbeans.api.project.level=FINE Took me a while to track down the problem as it only manifests after reopening the project, when I decide to try out NetBeans 7.0. Turns out 6.9.1 has the same problem as well.
I triggered the bug by generating a sanitized pom.xml (to work around MNG-4223) in the target directory. The work-around is to rename the pom.xml in target directory to saner-pom.xml. But this is a bug that needs to be fixed nonetheless, as it's extremely mystifying and hard to track down when suddenly generated sources are not recognized after I restart the IDE, which is sometime (in my case 3 work days and 1 week of vacation) later.
Right, using target/saner-pom.xml would be the workaround. A fully general check in the ProjectFactory that pom.xml is not contained anywhere within some other project's build output would probably be too expensive, but could introduce some special handling for this case (pom.xml under dir named 'target' and parent dir also contains pom.xml) under the assumption it is especially common and especially problematic.
core-main #88566972cc2d
Integrated into 'main-golden', will be available in build *201105050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/88566972cc2d User: Jesse Glick <jglick@netbeans.org> Log: #198162: ${basedir}/target/pom.xml causes ${basedir}/target/ to be treated as a nested project