title: How can I exclude directory while using gradle's "compile project"?
body: <p>There are two modules in my project and module <strong>A</strong> depends on module <strong>B</strong>.
  For building this with <strong>Gradle</strong> I've used a simple code in the A's <strong>build.gradle</strong> file:</p>
  
  <pre><code>compile project(":B")
  </code></pre>
  
  <p>My issue is a collision of <strong>resources</strong> directories.
  What I want to do is to exclude certain B's module "resource" directory.</p>
  
  <p>What I've tried:</p>
  
  <pre><code>compile (project(":B")) {
          exclude group : 'src.main', module : 'resources'
      }
  </code></pre>
  
  <p>What I've tried as well:</p>
  
  <pre><code>compile(project(":B")) {
          exclude module: 'src'
          exclude module: 'main'
          exclude module: 'src/main'
          exclude module: 'src.main'
      }
  </code></pre>
  
  <p>By excluding the root of module B, I'm expecting to get failed build of whole project, but nothing happens.</p>
  
  <p>P.S. Every time I'm running build, I'm cleaning compiled jars, so they are not cached.</p>