Creating all-in-one-zip in a multi project build

I see there are multiple discussions on this topic in the forum. But none of the solutions worked for me. Hence posting this.

I have a project structure like this:

– subProject
   - childProject1
   - childProject2
   - childProject3

settings.gradle at root project has this: = 'cssTheme'
// alphabetical order
include \

my top level build.gradle has this:


def publishGroup = project.baseGroup
def cssTheme = file("./allcss/")
project.configurePublishingPublications project, {
   publishCustomTheme(MavenPublication) {
       groupId publishGroup
       setArtifactId 'cssTheme'
       artifact cssTheme 

task themesZipFileTask(type:Zip) {
 dependsOn subprojects*.build
 from ('./common/common.css')
    archiveName ("")
build.finalizedBy tasks.themesZipFileTask

project.configureArtifactoryPublications project,

I am using gradle 1.12.

I have following questions:

  1. Is it possible to create a zip file with all the subprojects built artifacts at the root project level? I see that the zip task is called only at config phase, not at execution. Is this expected behavior?

  2. if (1) is not possible, what is the best way to aggregate all the subprojects artifacts into one file?

  3. If (1) is possible, then, what am I missing in the code? I have noticed that only “common.css” (Which is a static file) goes into the zip. None of the other css files are there.

As a start, you should probably update Gradle.
1.12 is almost 10 years old, many many things changed since then.

Besides that, if you split your code into multiple artifacts, you should usually just publish all of them as separate artifacts with proper dependencies.

If you really want to use artifacts produced from other projects, you need to follow this: Sharing outputs between projects