How can I exclude some folders from my Eclipse project?

I am adding an eclipse project to our existing code base, and I would like to know if there is a way to exclude some directories from what you are picking up eclipse? The reason is that we have a huge "third-party" directory in our repository, which cannot be present in the project for para-programming , which we use to be able to synchronize efficiently.

Any clues?

+84
eclipse project
Jul 27 '09 at 12:19
source share
5 answers

Filters will hide resources from view, but they are still in the project. If you create the project elsewhere, you can create related resources in the folders that you want to include in your project.

As a reference, I posted another answer, which describes in more detail the use of related resources .

+15
Jul 27 '09 at 12:30
source share

There is a direct way:

  • Right-click the project folder in the tree of the project explorer and go to "Properties".
  • Resource β†’ Resource Filters.
  • Add as many exclusion filters for files / folders as you want.

PS If your project tree does not update automatically, you may need to press F5, having the input focus in the Project Explorer window.

+189
Jun 12 '11 at 11:23
source share

Yes, you can place your own filter in your project. In the project explorer view, on the "Package Explorer" tab, the down arrow should be located at the top of the panel. Click on it and go to the "Filters" section. From there, you can specify specific folder templates that you do not want to detect by checking the box next to the name filter templates. In this case, I would name the name of the third-party library.

+6
Jul 27 '09 at 12:26
source share

The way I have always done this is to explicitly test projects as peers. eg:

 ~ / myworkspace / goodproject
 ~ / myworkspace / 3rdparty

then import only the β€œgood project” into eclipse. If "3rdparty" is a goodproject subdirectory, you can fake it ... Let's say, for example, your svn project looks like this:

 project /
        src /
           main /
           3rdparty /

You can create the project / src / then checkout locally only in the main directory, and eclipse rely on the packaged version (for example, point to the jar if your project is java).

+1
Jul 27 '09 at 12:40
source share

If you want to add filters directly to the .project file, here are a few rules:

<type>6</type> <!-- exclude all, files --> <type>5</type> <!-- include only, files --> <type>13</type> <!-- include only, files and folders --> <type>26</type><!-- exclude all, folders, all children --> <arguments>1.0-name-matches-false-false-xyz</arguments> <!-- case sensitive=false, regular expression=false, something named=xyz --> <arguments>1.0-name-matches-true-false-EEE</arguments> <!-- case sensitive = true, regular expression = false, something named=EEE --> <arguments>1.0-name-matches-false-false-www</arguments> <!--case sensitive=false, regular expression = false, something named=www --> 

One section of the .project filter, for example:

  <filteredResources> <filter> <id>1567020347706</id> <name></name> <type>6</type> <!-- exclude all, files --> <matcher> <id>org.eclipse.ui.ide.multiFilter</id> <arguments>1.0-name-matches-false-false-abc</arguments> </matcher> </filter> <filter> <id>1567020347708</id> <name></name> <type>5</type> <!-- include only, files --> <matcher> <id>org.eclipse.ui.ide.multiFilter</id> <arguments>1.0-name-matches-false-false-xyz</arguments> <!-- case sensitive=false, regular expression=false --> </matcher> </filter> <filter> <id>1567020347711</id> <name></name> <type>13</type> <matcher> <id>org.eclipse.ui.ide.multiFilter</id> <arguments>1.0-name-matches-false-false-mno</arguments> </matcher> </filter> <filter> <id>1567020347713</id> <name></name> <type>26</type><!-- exclude all, folders, all children --> <matcher> <id>org.eclipse.ui.ide.multiFilter</id> <arguments>1.0-name-matches-true-false-EEE</arguments> <!-- case sensitive = true, regular expression = false --> </matcher> </filter> <filter> <id>1567020347716</id> <name></name> <type>26</type> <!-- exclude all, folders, all children --> <matcher> <id>org.eclipse.ui.ide.multiFilter</id> <arguments>1.0-name-matches-false-false-www</arguments> <!-- case sensitive = false, regular expression = false --> </matcher> </filter> </filteredResources> 
0
Aug 28 '19 at 19:36
source share



All Articles