I am using the following code to embed some dependencies in my jar:
jar {
from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }
}
However, two of my dependencies both contain a LICENSE.txt
, resulting in a java.util.zip.ZipException: duplicate entry: LICENSE.txt
. exception.
How can I modify the code to exclude both LICENSE.txt
s from the jar? I tried adding an exclude "LICENSE.txt"
to jar
, but that still results in an exception.
After searching some more, I found an answer here.
jar {
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "LICENSE.txt"
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments