Gradle 3.0 Copy task no longer gets task dependencies from with call

issue-acknowledged
gradle-3554

(Wesley Hartford) #1

Gradle Version: 3.0
Operating System and JVM version: Linux, OpenJDK 1.8.0_91
Is this a regression? If yes, which version of Gradle do you know it last worked for?

Build scan of working build with gradle version 2.14.1: https://scans.gradle.com/s/fa5trfw55rg7i
Build scan of borken build with gradle version 3.0: https://scans.gradle.com/s/r2qnmkyvzyoxq

In a war project, I used a task like the following to produce a directory containing the exploded war contents:

    task explodedWar(type: Copy) {
      into "$buildDir/explodedWar"
      with tasks.war
    }

This seems to be a common approach based on google searches, and the recommended workaround from GRADLE-1445.

After upgrading to gradle 3.0, the explodedWar task does not inherit any of the task dependencies of the war task. Executing the task on its own performs the expected copy actions, but does not depend on any of the other build tasks which produce class files, resources, etc. Is this expected behaviour?

A simple work around exists, that is to add explicit dependencies to the exploded war task as in:

    task explodedWar(type: Copy) {
      into "$buildDir/explodedWar"
      with tasks.war
      dependsOn tasks.classes
    }

(Lóránt Pintér) #2

Thanks for the detailed report. This is a regression (see GRADLE-3554). It will be fixed in Gradle 3.1.