How to Unzip compile Project dependency jar file and extract resources


I want to extract compile project(‘myschool’) in distZip task and extract resources files with filter of .json files.

I tried all ways but not succeeded. Please help meout how to iterate all other deps and extract resources.

Jars I want to extract are snapshot jars.(ex: compile project(‘myschool’))

Sample Script

task buildZip(type: Zip, dependsOn: [ build ]) {
baseName = 'myschool-app'

 from (configurations.dist) {
    duplicatesStrategy = 'exclude'
    into 'lib'

 from (copyResourcesOfDeps){
	duplicatesStrategy = 'exclude'
 from(copyConfigFiles) {
    duplicatesStrategy = 'exclude'

task copyResourcesOfDeps(type: Copy) {
	dependsOn configurations.bundle
	//configurations.compile.collect{ print it }
	from {
		configurations.compile.collect{ zipTree(it) }
	include 'beans.*.xml'
 	include 'routes.*.xml'

What is the relationship of the „distZip task“ to the „task buildZip“ you’ve shared in your snippet?

Can you share the output that Gradle reports when your script fails, please?

By „snapshot jars“ I am assuming you mean artifact jar files that have the „-SNAPSHOT“ suffix. Is that right?

Please, can you share the part of your build script that has the compile project(‘myschool’) line?