Howdy,

as the title suggests, I would like to know whether it is possible to create a FatJar containing the exploded file contents of the created build artifacts directly from the root project with a Java multi-project build.

I've tried various approaches, but I cannot quite get my head around the problem.

The code below shows the approach that came most closely:

task myjar(type: Jar) {
    baseName = 'fatjar'

    project.subprojects.each { subproject ->
        from subproject.configurations.default.allArtifactFiles
    }
}
tasks.myjar.dependsOn(':subproject:jar')


Here I end up with a file fatjar-1.0.jar that contains the file subproject-1.0.jar. But I would rather want the contents of subproject-1.0.jar end up in the fatjar.

From the documentation I've learned that project#zipTree() does this sort of explosion, but it does no good here as at the time of evaluation the artifact does not yet exist! Earlier Gradle versions came with a merge feature that might have proven useful here.

Does anyone know of a way to achieve the desired behavior with the current Gradle release? Thanks in advance for any help.

Cheers,

Marco

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to