Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micronaut JacocoReportAggregationPlugin broken in Gradle 8.2 #25618

Closed
tresat opened this issue Jul 5, 2023 · 3 comments
Closed

Micronaut JacocoReportAggregationPlugin broken in Gradle 8.2 #25618

tresat opened this issue Jul 5, 2023 · 3 comments
Assignees
Milestone

Comments

@tresat
Copy link
Member

tresat commented Jul 5, 2023

Expected Behavior

Success with Gradle 8.1.1: https://ge.micronaut.io/s/z4db5b7satq26/dependencies?focusedDependency=WzAsMCwxMjM0LFswLDAsWzEyMzRdXV0&toggled=W1swXSxbMCwwXV0

Current Behavior

Failure with Gradle 8.2: https://ge.micronaut.io/s/kruw4j3titqcs/failure

Context (optional)

Selection of classDirectories in the JacocoReport task is failing due to too many matching variants when a project applies the jacoco-report-aggregation plugin and its project dependency applies the java-test-fixtures plugin and contains test fixtures, which also make a classes variant such as:

- Configuration ':micronaut-openapi-generator:testFixturesRuntimeElements' variant classes declares a component, preferably in the form of class files:

available. The failure is due to an ArtifactView that uses withVariantReselection(), the originating Configuration reported in the error message is not problematic. Reselection should not be used to select class directories here.

Steps to Reproduce

See new integration test in JacocoAggregationIntegrationTest or rerun the Micronaut build at this commit using Gradle 8.2.

Gradle version

8.2

Gradle version that used to work

8.1.1

@tresat tresat added a:regression This used to work to-triage labels Jul 5, 2023
@tresat tresat self-assigned this Jul 5, 2023
@tresat tresat added this to the 8.2.1 milestone Jul 5, 2023
@tresat tresat changed the title Changes to Configuration breaks Micronaut TestAggregation usage in Gradle 8.2 Micronaut JacocoReportAggregationPlugin broken in Gradle 8.2 Jul 6, 2023
@asoftwareguy
Copy link

asoftwareguy commented Jul 6, 2023

We are having the same issue in our project using jacocoAggregation:

Could not determine the dependencies of task ':code-coverage-report:check'.
> Could not create task ':code-coverage-report:testCodeCoverageReport'.
   > Could not resolve all files for configuration ':code-coverage-report:aggregateCodeCoverageReportResults'.
      > The consumer was configured to find a component, preferably in the form of class files. However we cannot choose between the following variants of project :app:
          - Configuration ':app:apiElements' variant classes declares a component, preferably in the form of class files:
              - Unmatched attributes:
                  - Provides attribute 'artifactType' with value 'java-classes-directory' but the consumer didn't ask for it
                  - Provides a library but the consumer didn't ask for it
                  - Provides its dependencies declared externally but the consumer didn't ask for it
                  - Provides compatibility with Java 17 but the consumer didn't ask for it
                  - Provides compile-time but the consumer didn't ask for it
          - Configuration ':app:testFixturesRuntimeElements' declares a component, packaged as a jar:
              - Unmatched attributes:
                  - Provides attribute 'artifactType' with value 'jar' but the consumer didn't ask for it
                  - Provides a library but the consumer didn't ask for it
                  - Provides its dependencies declared externally but the consumer didn't ask for it
                  - Provides compatibility with Java 17 but the consumer didn't ask for it
                  - Provides runtime but the consumer didn't ask for it
           ...

@tresat
Copy link
Member Author

tresat commented Jul 6, 2023

@asoftwareguy - Looks like the same error. This fix should be available in Gradle 8.2.1, coming very soon.

bot-gradle added a commit that referenced this issue Jul 6, 2023
…co report aggregation with only the `classes` attribute present

<!--- The issue this PR addresses -->
Fixes #25618

Co-authored-by: Thomas Tresansky <ttresansky@gradle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants