title: Using include and exclude in the jar command in gradle does not include all of the classes needed
body: <p>I need to create a jar from a subset of java classes in my project.
  I have 3 tasks: (Copy, Compile, Jar)
  The copy and compile tasks work fine.
  They are below for reference:
      1. Copy files to a directory that are needed to compile the jar.  There are additional files needed in this directory that are needed in the compile but not included in the jar files.</p>
  
  <pre><code> task copyCoreSharedFiles(type: Copy) {
          includeEmptyDirs = false
          from ('src/java/com/')
      (List of includes and excludes) 
          into  rootProject.rootDir.getAbsolutePath() + "/target" +"/coreshared"
          println 'Copied core-shared files into directory'   
      }
  2. Compile the java files and stored to another directory
  
  
   task compileCoreShareJar(type: JavaCompile) {
          source = file('target/coreshared')
          destinationDir = file('target/buildtmp/core')
          classpath = configurations.compile
          println 'Compiled core-shared files into directory' 
      }
  </code></pre>
  
  <p>I am having trouble jarring all of the class files.
  The task in below.</p>
  
  <pre><code>task jarCoreShareClassFiles(type: Jar) {
      includeEmptyDirs = false
      archiveName = "core-shared-SNAPSHOT.jar"
      destinationDir = file("$rootDir/target/lib/")
      from file('target/buildtmp/core')
      include('**/com/common/*')
      include('**/com/javaserver/*')
      exclude('**/com/javaserver/dock/transaction/PrintTransaction.class')
  
      println 'Jar core-shared files into directory'
  }
  </code></pre>
  
  <p>I need to include and exclude specific directories and files.
  When I use <code>include('**/com/common/*')</code> it includes the <strong>common</strong> directory files but not the subdirectory <strong>local</strong> under the <strong>common</strong> directory.
  It does not include the <strong>javaserver</strong> directory at all.</p>
  
  <p>How do I use <code>include</code> and <code>exclude</code> in the jar command?</p>