Skip to content

Removing the default classifier with the archiveClassifier property #463

@bmuschko

Description

@bmuschko

Shadow Version

5.0.0

Gradle Version

5.2.1

Expected Behavior

Default classifier set by ShadowJar task can be removed from a build script.

Actual Behavior

I can only remove the -all classifier via the following code (which is deprecated):

tasks.named<ShadowJar>("shadowJar") {
    classifier = null
}

I was out of luck using the archiveClassifier attribute e.g. via the following code:

tasks.named<ShadowJar>("shadowJar") {
    archiveClassifier.set("")
}

The -all classifier is still added to the archive. Can you give an example on how to remove the -all classifier with the archiveClassifier property?

I see that the relevant code sets the classifier via convention mapping and the new attribute archiveClassifier. Should the convention mapping code go into an else branch to only kick in when you are using an older Gradle version than 5.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions