Skip to content

Relocation pattern is not a part of the ShadowJar fingerprint #1932

@abdulowork

Description

@abdulowork

Expected and Results

Changes to the relocation pattern should make the ShadowJar task rerun and should change the build cache fingerprint, but instead currently the ShadowJar task is errouneously up-to-date or is incorrectly pulled from the build cache

Related environment and versions

No response

Reproduction steps

Create the following build script:

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
    `java-library`
    id("com.gradleup.shadow") version "9.3.1"
}
repositories { mavenCentral() }
dependencies { implementation(kotlin("stdlib", "2.3.0")) }

tasks.withType<ShadowJar>().configureEach {
    relocate("kotlin", "foo")
}
  1. Run ./gradlew :shadowJar -i the first time. The task runs as expected and relocates kotlin package to foo
  2. Change relocation pattern from foo to bar
  3. Rerun ./gradlew :shadowJar -i and the task will be incorrectly up-to-date

A similar issue occurs in the build cache reuse scenario

Image

Anything else?

It seems this entity should have the pattern as an @Input

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