title: Gradle error when creating a fat jar
body: <p>I'm trying to create a fat jar using Gradle. I'm running into an error similar to this one <a href="https://issues.gradle.org/browse/GRADLE-2958" rel="nofollow">raised against Gradle</a>. Unfortunately I don't understand Gradle nor Groovy enough to come up with a creative workaround so I'm hoping someone here would be able to help. I've searched online for various workarounds to no avail :(</p>
  
  <p>My particular conflict is with the Apache Storm dependency:</p>
  
  <pre><code>...
  Caused by: org.gradle.api.GradleException: Could not copy zip entry /Users/DefaultUser/.gradle/caches/modules-2/files-2.1/org.apache.storm/storm-core/0.10.0-beta1/c3ba45e5ba616335c9f4be12317a8ebf2d2f17ba/storm-core-0.10.0-beta1.jar!META-INF/license/LICENSE.base64.txt to '/Users/DefaultUser/Projects/streams/build/tmp/expandedArchives/storm-core-0.10.0-beta1.jar_6i3o5dzb4lwfvasqr1cg4giqy/META-INF/license/LICENSE.base64.txt'.
      at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79)
      at org.gradle.api.internal.file.archive.ZipFileTree$DetailsImpl.getFile(ZipFileTree.java:125)
      at org.gradle.api.internal.file.AbstractFileTree$1.visitFile(AbstractFileTree.java:39)
      at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree$1.visitFile(AbstractFileTree.java:145)
      at org.gradle.api.internal.file.archive.ZipFileTree.visit(ZipFileTree.java:90)
      ... 50 more
  Caused by: org.gradle.api.UncheckedIOException: Cannot create directory '/Users/DefaultUser/Projects/streams/build/tmp/expandedArchives/storm-core-0.10.0-beta1.jar_6i3o5dzb4lwfvasqr1cg4giqy/META-INF/license' as it already exists, but is not a directory
      at org.gradle.util.GFileUtils.mkdirs(GFileUtils.java:261)
      at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:73)
      ... 54 more
  </code></pre>
  
  <p>My gradle code to create a fat jar is as follows:</p>
  
  <pre><code>jar {
  
      manifest {
          attributes 'Main-Class': mainClassName,
                  'Implementation-Version': version
      }
  
      from {
          configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
      }
  }
  </code></pre>