Skip to content

Warning since Gradle 7.x: Execution optimizations have been disabled for task ':processResources' #38

Open
@bwaldvogel

Description

I’m using the XJC Gradle plugin (version 2.0.0) with the configuration

sourceSets {
    main {
        xjcCatalog.srcDir("my/package")
        xjcTargetPackage = "my.package"
    }
}

xjc {
    extension = true
}

After upgrading Gradle from 6.x to 7.x, I get the following new warning when assembling the project via ./gradlew assemble:

> Task :processResources
Execution optimizations have been disabled for task ':processResources' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: 'my-project/build/generated/resources'. Reason: Task ':processResources' uses this output of task ':xjcGenerate' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: 'my-project/build/generated/resources/xjc/main'. Reason: Task ':processResources' uses this output of task ':xjcGenerate' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.

To hide the warning, I declared an explicit task dependency as a temporary workaround:

processResources.dependsOn xjcGenerate, xjcGenerateTest

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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