gradle to bundle nested jar dependencies into module output jar

≯℡__Kan透↙ 提交于 2019-12-07 11:43:27

问题


How to make gradle to included some dependencies into module resulted jar as jar? i.e. to make jar with nested jar's e.g. in lib folder ?

This is not Android project, and this should be done for many modules in multi-module project, so fatJar, uberJar, shadowJar alike solutions seem not to fit.


回答1:


You just need to add an additional from directive to include dependencies in your jar:

task jarJar(type: Jar) {
    baseName = project.name + '-jarjar'
    from { configurations.compile }
    with jar
}


来源:https://stackoverflow.com/questions/36336709/gradle-to-bundle-nested-jar-dependencies-into-module-output-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!