开发者

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').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜