# Eclipse Pluging: Adding Resource Filters

**URL:** <https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408>\
**Category:** Old Forum Archive\
**Created:** [July 12, 2012, 6:41pm UTC](https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408 "2012-07-12T18:41:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart\_spedden](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bart\_spedden](https://discuss.gradle.org/u/bart_spedden)\
**Post date:** [July 12, 2012, 6:41pm UTC](https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408/1 "2012-07-12T18:41:00Z")

</div>

Is there a way to have eclipse ignore the build directory?

In eclipse I can manually add them by going to Project Properties -\> Resource -\> Resource Filter and then adding a filter to exclude the build directory. I haven’t found how to this via the documentation, the forum, or google.

Thanks.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [July 12, 2012, 10:06pm UTC](https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408/2 "2012-07-12T22:06:00Z")

</div>

To my knowledge, Gradle’s Eclipse plugin can’t set resource filters. The future of Eclipse tooling is the Eclipse Gradle plugin (part of SpringSource Tool Suite), which might already set such a filter. If not, it would make a good feature request.

---

<div class="post-metadata">

**Author:** ![rolfsuurd1](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rolfsuurd1](https://discuss.gradle.org/u/rolfsuurd1)\
**Post date:** [July 13, 2012, 9:03am UTC](https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408/3 "2012-07-13T09:03:00Z")

</div>

You will have to manually manipulate the eclipse project file generated in your build:

```gradle
eclipse {
 project {
  file {
   withXml { xmlProvider ->
    Node project = xmlProvider.asNode()
          Node filter = project.appendNode('filteredResources').appendNode('filter')
      filter.appendNode('id', 2889034)
     filter.appendNode('name', 'build filter')
    filter.appendNode('type', 10)
      Node matcher = filter.appendNode('matcher')
    matcher.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
    matcher.appendNode('arguments', '1.0-name-matches-false-false-build')
   }
  }
 }
}

```

---

<div class="post-metadata">

**Author:** ![bart\_spedden](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bart\_spedden](https://discuss.gradle.org/u/bart_spedden)\
**Post date:** [July 13, 2012, 4:10pm UTC](https://discuss.gradle.org/t/eclipse-pluging-adding-resource-filters/5408/4 "2012-07-13T16:10:00Z")

</div>

Thanks Rolf, this definitely gets me heading the correct direction. Your solution works perfectly from the command line. I’m seeing some issues when importing a project with subprojects via the sts gradle plugin that I believe is related to the cleanEclipse call, but I’m not sure yet. i’ll keep digging and report back when I get this resolved.
