If you put the above code into a subprojects { .. }
block in the root build script, you can invoke all tasks at once with gradle uploadMyConfiguration
. (Only) if you have a concrete need for a single task (e.g. because another task depends on all artifacts being uploaded), you can add a further lifecycle task:
task uploadAll {
dependsOn { subprojects.uploadMyConfiguration }
}
PS: Unless you have a good reason not to, you can reuse the existing archives
configuration and uploadArchives
task. The archives
configuration already contains the Jar produced by the jar
task, so you just have to add the sources
Jar.