Gradle fat jar _leaving out_ META-INF from child jars?
Is there any way to leave out certain paths from a Gradle fat jar.
I am using:
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
from
http://docs.codehaus.org/display/GRADLE/Cookbook
and would like to leave out META-INF directories if possible.
Thank you! Mi开发者_如何学Pythonsha
I haven't extensively tested it, but this should do what you're asking for:
jar {
from configurations.compile.collect {
it.isDirectory() ? it : zipTree(it).matching{exclude{it.name == 'META-INF'}}
}
}
Yes, the above by TheKaptain works except instead of: it.name == 'META-INF' use: it.path.contains('META-INF').
精彩评论