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.
It looks like NetBeans subdirectories not listed in POM.xml. E.g. I have following file/folder structure: .\prjdir\ pom.xml src\ .. project files ... target\ .. autogenerated files xxx\ .. some dumb staff needed to be placed into this folder, which does not contain real source files When I try to search for something in my projects (Edit -> Find -> Scope: Open Project) I expect to look only in folders defined as source folder in POM.xml which are listed below, but i also get matches from xxx folder. Note XXX is not listed in Projects window, i.e. MAVEN directories are already handled correcty somewhere: <build> <sourceDirectory>...</sourceDirectory> <scriptSourceDirectory>...</scriptSourceDirectory> <testSourceDirectory>...</testSourceDirectory> <resources> <resource> <directory>...</directory> </resource> </resources> <testResources> <testResource> <directory>...</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </testResource> </testResources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <webResources> <resource> <directory>...</directory> </resource> </webResources> </configuration> </plugin> </plugins>
I'm not sure how this is influenced by the project type. reassigning for evaluation
I suspect each project type in Netbeans has its own logic regarding location of the source files. For MAVEN projects source/resource folders are defined explicitly in POM.xml. This MAY NOT be the case for other project types and therefore this bug may not apply to other project types.
Edit -> Find is not a part of jump to module.
> Netbeans scans files in subdirectories not listed in POM.xml Yes, but this is intentional. It recursively scans the project directory. Changing this behavior would affect users that have some important data in non-source directories. I would suggest: 1) Use find usages (if you are searching for some method, class, etc. occurrences). 2) Add the xxx folder to ignored folders (Find in Projects -> Use Ignore List -> Edit -> Add Folder) Would it work for you?
It may be my personal attitude, not applicable to most of other users, but - no, I do not think this will 'normally' work for me. The reasons are ... 1. When I select scope="Open Projects" or "Current Project" I do expect to search in the files really "included" into project. If I would like to search for just files, I would choose "Browse ... " and select the folder I need to scan. Getting matches from files located in some 'temp' folders under project root is a bit misleading and heaving 'temp' (let's call them - non source) folders is rather normal case in multi-module MAVEN project - in that case sub-projects are put into sub-folders under parent MAVEN project and finally root project will cause scanning of everything under it ... what causes another problem ... 2. ... performance ... See this bug for details: https://netbeans.org/bugzilla/show_bug.cgi?id=239769. This actually negatively affects performance and user experience in many areas - searching, goto file, goto symbol.
Created attachment 144585 [details] Plugin with the new search scope - Sources (ZIP)
Created attachment 144586 [details] Plugin with the new search scope - NBM
OK, I understand the problem, however I think it's quite a minor case. I still think that the current behavior shouldn't be changed. Better solution would be adding a new search scope that searches only in source and resource folders of open projects. I'm not sure it should be in the standard distribution, but it can be easily implemented as a plugin (and published in plugin portal). I've just attached a prototype implementation of such plugin. Please test it and let me know whether it works fine for you. Thank you.
Yes, having additional pre-configured 'search scope' does solve the problem for this bug. I'll check how provided plugin works later when have time. Meanwhile ... may you notice some relevance between this issues and performance problems described in this bug https://netbeans.org/bugzilla/show_bug.cgi?id=239769?
(In reply to NukemBy from comment #9) > Meanwhile ... may you notice some relevance between this issues and > performance problems described in this bug > https://netbeans.org/bugzilla/show_bug.cgi?id=239769? The cause of the problem is probably the same, but Search in Projects and Go to File are quite different, independent modules.