I have below sample in build.gradle. My requirement is to include the jars jar1 (with its dependencies) and jar3 (with its dependencies) as part of my final jar. How can I do that ? I have searched a lot for this, although i found a solution here https://stackoverflow.com/a/43374638/1403009 but i can only include one package name as part of jar building task. In this case, I need multiple such packages/groups to be included as part of my final jar.
..
..
configurations {
runTimeJars
}
dependencies {
configurations.compile.extendsFrom(configurations.runTimeJars)
runTimeJars'group1:jar1'
compile 'group1:jar2'
runTimeJars'group1:jar3'
}
jar {
zip64 true
from {
configurations.runTimeJars.collect { it.isDirectory() ? it : zipTree(it) }
}
}