# Jacoco-report-aggregation odd error

**URL:** <https://discuss.gradle.org/t/jacoco-report-aggregation-odd-error/42295>\
**Category:** Help/Discuss\
**Created:** [February 24, 2022, 4:11pm UTC](https://discuss.gradle.org/t/jacoco-report-aggregation-odd-error/42295 "2022-02-24T16:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjaggard](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mjaggard/32/9689_2.png) [@mjaggard](https://discuss.gradle.org/u/mjaggard)\
**Post date:** [February 24, 2022, 4:11pm UTC](https://discuss.gradle.org/t/jacoco-report-aggregation-odd-error/42295/1 "2022-02-24T16:11:48Z")

</div>

Once I resolved the issue described here: [Jacoco-report-aggregation with custom maven repository](https://discuss.gradle.org/t/jacoco-report-aggregation-with-custom-maven-repository/42243) (in my case I needed to apply my own conventions plugin - I didn’t expect that to be needed because the tests have already run so I didn’t think dependencies would be needed by the aggregating project)

I then had a problem that the plugin seems to be trying to parse one of my jar files 🤷‍♂️

```gradle
Task ':aggregate:testCodeCoverageReport' is not up-to-date because:
  Task has failed previously.
[ant:jacocoReport] Loading execution data file /Users/mybuild/backend/api-v1/build/jacoco/test.exec
[ant:jacocoReport] Loading execution data file /Users/mybuild/backend/api-v2/build/jacoco/test.exec
[ant:jacocoReport] Loading execution data file /Users/mybuild/backend/engines/build/jacoco/test.exec
[ant:jacocoReport] Loading execution data file /Users/mybuild/backend/shared/build/jacoco/test.exec
[ant:jacocoReport] Loading execution data file /Users/mybuild/backend/shared/build/libs/shared-0.0.1-SNAPSHOT-tests.jar
:aggregate:testCodeCoverageReport (Thread[Execution worker for ':' Thread 11,5,main]) completed. Took 1.858 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':aggregate:testCodeCoverageReport'.
> Unable to read execution data file /Users/mybuild/backend/shared/build/libs/shared-0.0.1-SNAPSHOT-tests.jar

```

---

<div class="post-metadata">

**Author:** ![mjaggard](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mjaggard/32/9689_2.png) [@mjaggard](https://discuss.gradle.org/u/mjaggard)\
**Post date:** [February 24, 2022, 4:19pm UTC](https://discuss.gradle.org/t/jacoco-report-aggregation-odd-error/42295/2 "2022-02-24T16:19:09Z")

</div>

I see from the source code of the plugin that it uses files generated by any task from JacocoTaskExtension. I have no idea why this JAR would be included. The code for creating it is like this:

```gradle
tasks.register('testsJar', Jar) {
    archiveClassifier = 'tests'
    from(sourceSets.test.output)
}

configurations {
    testArtifacts
}

artifacts {
    testArtifacts testsJar
}

publishing.publications.maven.artifact(testsJar)

```

---

<div class="post-metadata">

**Author:** ![Tom\_Tresansky](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tom_tresansky/32/9360_2.png) [@Tom\_Tresansky](https://discuss.gradle.org/u/Tom_Tresansky)\
**Post date:** [March 2, 2022, 5:15pm UTC](https://discuss.gradle.org/t/jacoco-report-aggregation-odd-error/42295/3 "2022-03-02T17:15:05Z")

</div>

Can you please post a link to a full reproducer? I’m wondering how this could happen and was looking to recreate the issue, but not having any success so far.
