Exclude target folder from search results in Eclipse

EclipseJakarta EeMaven 2

Eclipse Problem Overview


I was wondering if it's possible to exclude target folder from eclipse quick search :

Ctrl+Shift+R

If anyone knows how to do that, please advise.

Update: I am using Maven 2, and M2E , WTP Eclipse plug-ins.

Eclipse Solutions


Solution 1 - Eclipse

  1. Mark the "target" folders as "derived" resource from the properties screen of those folders (this option is next to read only and archive property).

  2. In the quick search (Ctrl+Shift+R) screen press the arrow in the top right corner and untick "Show derived resources".

Then those target-files will not be considered in the quick search anymore.

Solution 2 - Eclipse

Go to Add Resource Filter preferences dialog:

Go to ProjectPropertiesResourceResource Filters

Click Add Filter...

Then fill the options:

Filter type:

()Exclude all

Applies to:

()Folders

[X] All children (recursive)

Filter and Folder Attributes:

Name - Matches - [target]

Solution 3 - Eclipse

You can install AutoDeriv plugin from Eclipse Marketplace or http://nodj.github.io/AutoDeriv/. It allows you to create either global(workspace) or per-project .derived files in which you can specify which files/folders should be marked as derived.

Here's a sample config file (taken from plugin's homepage):

# set the 'target' and 'ext' folders as derived
target
ext
# but don't affect the 'keep' sub-folder
!target/keep
# all files with a '.dep' extension are generated
*.dep
src/include/version.h # this specific file is also generated.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMahmoud SalehView Question on Stackoverflow
Solution 1 - EclipseChrisView Answer on Stackoverflow
Solution 2 - Eclipsenilan59View Answer on Stackoverflow
Solution 3 - EclipseDariuszView Answer on Stackoverflow