title: gradle: exclude a dependency in making fatJar
body: <p>There are lots of repeated answers on how to exclude an individual file from a fatJar. Typically, the file is excluded are in META-INF and they are excluded either because of a filename conflict, or because it is a signature copied from a dependency libarar Jar file which isn't valid for the newly created Jar file. </p>
  
  <p>Example for maven:
  <a href="https://stackoverflow.com/questions/30199035/how-can-i-tell-which-signed-jar-is-causing-maven-shade-plugin-to-fail">How can I tell which signed jar is causing maven-shade-plugin to fail?</a></p>
  
  <p>Example for gradle:
  <a href="https://stackoverflow.com/questions/36226033/removing-jar-signatures-in-gradle-build">Removing Jar Signatures in Gradle Build</a></p>
  
  <p>These solutions, however, only removed the offending file individually.</p>
  
  <p>How can we make a fatJar with a specific dependency library (not individual files in that library) excluded?</p>
  
  <p>For example, in question <a href="https://stackoverflow.com/questions/36226033/removing-jar-signatures-in-gradle-build">36226033</a>, it's easy to exclude the signature copied over from BouncyCastle, but is there a way to exclude the dependency library <code>bcprov-jdk15on-*.jar</code> entirely, so that the user must have the library available in order to execute the generated fat Jar?</p>
  
  <p>This is proven not working:</p>
  
  <pre><code>task fatJar(type: Jar) {
      manifest {
          attributes 'Implementation-Title': 'Gradle Jar File Example',
                  'Implementation-Version': version,
                  'Main-Class': 'com.alphawallet.scripttool.Main'
      }
      baseName = project.name + '-all'
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      exclude('**/bcprov-jdk15on-1.62.jar')
      with jar
  }
  
  </code></pre>
  
  <p>With <code>exclude('**/bcprov-jdk15on-1.62.jar')</code>, the content of that jar file is still copied over to the fat jar generated.</p>
  
  <p>Thanks. The motivation is to ship my Java application to systems that provides their own security library BouncyCastle (e.g. Debian Linux), instead of embeding an unsigned copy of that security library.</p>