Given the following dependency tree of a multi-module build.
myWar -> myImpl -> myDomain -> myLibrary -> 3rd party external dependencies.
For each of these java projects I am attaching a “resource” zip artifact to the “resource” configuration.
in the myWar project I would like to gather and merge the zip from each dependent project. in this way the configuration files and resources relevant to each subproject is stored with each project. These resources can be configuration templates so just putting them in the jar is not an option. I would like them externalized for further processing.
configurations { deliverables }
dependencies {
deliverables project(':myApp:myWar')
}
task deliver << {
//copy war files to a directory
//merge the resource.zip files from all transitive children of my 'deliverables'
}
In the case above I get only the jar of myWar. with configuration: archives I get just the war with configuration: resource I get just the resource
with
configurations {
archives { extendsFrom resource }
}
I can get both the war and the resource.zip – though I can’t seem to get at the transitive resource.zip files.
something like the ivy <dependency … conf=“config->config(default)” would help.
Is there a way short of listing each sub project resource configuration in the deliverables?
Ideally as the projects add code and configuration other consumers would immediately get them without having to modify the dependencies higher up the stack. This is akin to source jars; but I can’t seem to get those transitively either.
Any ideas are appreciated.