Skip to content

Multiple shadowJar tasks #138

@sergiofagostinho

Description

@sergiofagostinho

Hi,

I would like to have to multiple shadowJar tasks in my build.gradle. Namely, I would like to have different JAR names for each task. Here is what I've done:

shadowJar {
    mergeServiceFiles()
}

task shadowJar2(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
    mergeServiceFiles()
    archiveName = 'foo.jar'
}

The thing is, when I run the "shadowJar2" task, the "foo.jar" it produces includes only the manifest, no code. What's the correct way to do this?

P.S.: another person has posted a similar question on StackOverflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions