shadow icon indicating copy to clipboard operation
shadow copied to clipboard

Setting archive classifier breaking build with `application` plugin

Open srnyx opened this issue 3 years ago • 2 comments

Shadow Version

8.1.1

Gradle Version

8.1

Expected Behavior

The task should complete successfully with no errors

Actual Behavior

shadowJar task fails with this error: https://paste.srnyx.xyz/pukukumari.txt

Gradle Build Script(s)

build.gradle.kts: https://paste.srnyx.xyz/zoracapuyi.kts gradle/wrapper/gradle-wrapper.properties: https://paste.srnyx.xyz/cutamiyesi.properties

The issue seems to be with this part (it worked with Gradle 7.6 + Shadow 7.1.2) in combination with the use of the application plugin:

// Remove '-all' from the JAR file name
shadowJar {
    archiveClassifier.set("")
}

srnyx avatar Apr 16 '23 21:04 srnyx

Something related to Gradle 8.1 update:

* Exception is:
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':shadowJar' (type 'ShadowJar').
  - Gradle detected a problem with the following location: '[REDACTED]\cobalt\build\libs\Cobalt-1.2.0.jar'.
    
    Reason: Task ':startScripts' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':shadowJar' as an input of ':startScripts'.
      2. Declare an explicit dependency on ':shadowJar' from ':startScripts' using Task#dependsOn.
      3. Declare an explicit dependency on ':shadowJar' from ':startScripts' using Task#mustRunAfter.

Goooler avatar Apr 21 '23 02:04 Goooler

By the way, it only doesn't work when I use gradle build, when I use gradle shadowJar it works perfectly fine.

srnyx avatar Apr 21 '23 02:04 srnyx