I’m using shadow to create a distribution file containing fat jar with dependencies and all dist files together. The resulting directory tree in the Zip file looks like
If you don’t specify directory by into method, you can obtain zip file as you wish.
Here is a sample of archiving task.
task archiveZip(type: Zip, dependsOn: 'jar') {
baseName = 'project'
from fileTree('resources') // do not specify directory
// if you would like to put file into some directory, specify it.
from (tasks.jar.archivePath) {
into 'lib'
}
}