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.
See desc. When someone define additional Web resources in maven-war-plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <webResources> <resource> <directory>src/main/resources/production/webapp</directory> </resource> </webResources> </configuration> </plugin> Those additional web roots are shown separately in another Web Pages nodes and thus they shouldn't be listed in Other Sources node. For the proper fix we will need to enhance OtherSourcesExclude from core-maven to allow more than single folder for exclusion.
Created attachment 147974 [details] Potential fix Attaching patch with potential fix. Quick summarization: - The signature of core Maven OtherSourcesExclude (friend SPI class) has been changed and now it provides a list of Path that should be excluded in Other Sources - Both current implementation were changed to adapt the interface changes - NbMavenProjectImpl is implementing FileVisitor to check whole tree of sub-folders, not only direct children of src/main
CCing TomasS as an owner of the core maven module. Tomasi, could you please check if the changes are fine for you? Thanks in advance!
see MavenSourcesImpl.excludedFolders() is it guaranteed that project().getProjectDirectory().getFileObject("src/main/java") always returns a FO?
It is not! Thanks for the catch, I will improve the patch
Created attachment 148030 [details] Updated fix Few updates: - Excluding both src/main/java and src/test/java - NPE check for standardly excluded folders (it is common for certain types of Maven projects that e.g. src/main/java might not exist) - Skipping folders from the same sub-tree to avoid duplication in Other Sources node (I found that issue while testing other changes) Tomasi if something looks strange to you, feel free to ask. Otherwise I will push the changes tomorrow and ask someone from QA to test basic behavior which might be affected by the fix (I tested most of Maven project types and they seems to be working the same way as before).
Fixed by change-set: web-main #3efde7ab7fff
Integrated into 'main-silver', will be available in build *201407160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3efde7ab7fff User: Martin Janicek <mjanicek@netbeans.org> Log: #245520 - Additional web roots should not be shown in Other Sources