Gradle error when creating a fat jar -


i'm trying create fat jar using gradle. i'm running error similar 1 raised against gradle. unfortunately don't understand gradle nor groovy enough come creative workaround i'm hoping here able help. i've searched online various workarounds no avail :(

my particular conflict apache storm dependency:

... caused by: org.gradle.api.gradleexception: 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 '/users/defaultuser/projects/streams/build/tmp/expandedarchives/storm-core-0.10.0-beta1.jar_6i3o5dzb4lwfvasqr1cg4giqy/meta-inf/license/license.base64.txt'.     @ org.gradle.api.internal.file.abstractfiletreeelement.copyto(abstractfiletreeelement.java:79)     @ org.gradle.api.internal.file.archive.zipfiletree$detailsimpl.getfile(zipfiletree.java:125)     @ org.gradle.api.internal.file.abstractfiletree$1.visitfile(abstractfiletree.java:39)     @ org.gradle.api.internal.file.abstractfiletree$filteredfiletree$1.visitfile(abstractfiletree.java:145)     @ 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' exists, not directory     @ org.gradle.util.gfileutils.mkdirs(gfileutils.java:261)     @ org.gradle.api.internal.file.abstractfiletreeelement.copyto(abstractfiletreeelement.java:73)     ... 54 more 

my gradle code create fat jar follows:

jar {      manifest {         attributes 'main-class': mainclassname,                 'implementation-version': version     }      {         configurations.runtime.collect { it.isdirectory() ? : ziptree(it) }     } } 

after searching whole day looking workaround found 1 5 minutes after posted question...

this not ideal workaround excludes license got working via following. if has better solution i'd interested.

jar {      from(configurations.compile.collect { it.isdirectory() ? : ziptree(it) }) {         exclude "meta-inf/*.sf"         exclude "meta-inf/license"     }      manifest {         attributes 'main-class': mainclassname,                 'implementation-version': version     }  } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -