title: How to exclude a folder that is producing warnings/errors in an Eclipse project?
body: <p>Okay. I'm sick of this problem.  This <em>has to</em> have an easy fix, I'm sure of it!! I hope SO can help me to get rid of this once and for all!</p>
  
  <blockquote>
    <p><strong>Question</strong></p>
    
    <p>How do we get Eclipse to stop trying
    to process/compile all files under a
    particular project directory?  The
    goal is for no errors/warnings to
    exist in the problems view if they
    relate to something in this folder or it's subfolders.</p>
  </blockquote>
  
  <p><strong>Background</strong></p>
  
  <p>We run Eclipse 3.6 and the m2eclipse plugin v0.10.2.20100623 manages our autobuild. For reasons beyond my control, we have the entire BlazeDS distribution in our SVN project directory under <code>src/main/resources/blazeds</code>.  Essentially, this directory contains a vanilla distribution of tomcat running blazeds to which all our configuration and project files are added when we deploy to our server via SCP.</p>
  
  <p>So, when we run deploy, this version of tomcat is copied to the server and our project is placed inside.  Tomcat and our RIA application work and everything is fine.</p>
  
  <p>The problem is, Eclipse tries to compile everything under <code>src/main/resources/blazeds</code> when running AutoBuild and this generates about 300 errors/warnings in our problem view.  So when a real error surfaces, it gets lost among the noise.</p>
  
  <p>The errors stem from code in <code>/blazeds/tomcat/webapps/samples/testdrive-datapush</code> and also the <code>testdrive-httpservice</code>, <code>traderdesktop</code> example webapps. They have dependent source code that's not on the classpath and jars that aren't included in the libraries.</p>
  
  <p><strong>Failed Attempted Solutions</strong></p>
  
  <p>I'm trying to push the proper solution: to remove the samples completely and also to get blazeds out of our version control.  That's not happening anytime soon.</p>
  
  <p>I've followed the <a href="https://stackoverflow.com/questions/2514296/how-do-i-remove-error-warnings-made-by-tpl-files-in-my-eclipse-project">SO answer here</a> but it's only a very temporary solution.  I've tried adding exclusions everywhere I can think of and other members of my team have done the same.  I've removed <code>src/main/resources</code> as a source directory (in preferences > Java Build Path > Source Tab) I've added exclusions for <code>blazeds</code> under the resource directory.  I've tried every permutation of <code>blazeds</code> and <code>**</code> as in <code>*blazeds*</code>, <code>**/blazeds/**</code>, etc.</p>
  
  <p>I've even tried including the libraries and source files the compiler is complaining about but I couldn't get it right without excessively mangling our project configuration.</p>
  
  <blockquote>
    <p><strong>Summary</strong></p>
    
    <p>This has to be simple. What is the
    conventional way to exclude a folder
    that is producing warnings/errors in
    an eclipse project?</p>
    
    <p><hr>
    <strong><em>Update #1:</em></strong> <br>
    gedim's solution below is decent but it<br>
    1) doesn't clear red X's from the project<br>
    2) is a change everyone on our team needs to do, manually<br>(i.e., it's not in a project property file; thereby, it isn't checked into subversion)<br>
    <br>
    I hope there's a way to address the core problem by telling Eclipse that this directory doesn't contain<br>
    items to compile/validate. Such a change would likely show up in one of the project setting files.</p>
  </blockquote>
  
  <p><hr>
  <strong>Update #2:</strong></p>
  
  <p>The picture below shows the red X's I'm trying to clear and that<br>
  <code>Build Path &gt; Exclude</code> <br> isn't an option...</p>
  
  <p><img src="https://i.stack.imgur.com/auYdR.gif" alt="Red X&#39;s won&#39;t go away"></p>