Skip to content

Gradle 9 compatibility issue #138

@NielsDoucet

Description

@NielsDoucet

The gradle 9 support updates in this plugin introduced an issue that is marked as deprecated in gradle 8.14.3 and errors out in gradle 9.+.

Simple MCVE:

New gradle project with the following contents:
build.gradle.kts

plugins {
    java
    `jacoco-report-aggregation`
    id("io.qameta.allure") version "3.0.0"
}

repositories {
    mavenCentral()
}

settings.gradle.kts

rootProject.name = "test-allure"

pluginManagement {
    repositories {
        gradlePluginPortal()
    }
}

Run ./gradlew :testCodeCoverageReport --dry-run

gradle 8 deprecation warning:

Mutating a configuration after it has been resolved, consumed as a variant, or used for generating published metadata. This behavior has been deprecated. This will fail with an error in Gradle 9.0. The artifacts of configuration ':allureRawResultElements' were mutated after the configuration was consumed as a variant. After a configuration has been observed, it should not be modified. Consult the upgrading guide for further information: https://docs.gradle.org/8.14.3/userguide/upgrading_version_8.html#mutate_configuration_after_locking

gradle 9 error:

FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':testCodeCoverageReport'.
> Could not resolve all dependencies for configuration ':aggregateCodeCoverageReportResults'.
> Could not create task ':test'.
> Cannot mutate the artifacts of configuration ':allureRawResultElements' after the configuration was consumed as a variant. After a configuration has been observed, it should not be modified.

I believe the issue is caused by the following change:
https://github.com/allure-framework/allure-gradle/pull/125/files#diff-53c49873e630c9f00ea220d4fcb00986813315a201e075aff2411e8fa6b780b0R100-R106

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