Skip to content

Multi-module merge silently drops one project's coverage when two projects share the default capability (group:project.name collision) #825

Closed

Description

@corthx

Describe the bug
In a multi-module build using Kover's documented multi-module merge (apply org.jetbrains.kotlinx.kover to root + each submodule, then at the merging module: dependencies { kover(project(":a")); kover(project(":b")) }), if two of the merged projects happen to share the same project.name (while having different Gradle paths / directories), the merged :koverXmlReport silently contains coverage for only one of them. The build succeeds with no error or warning, the other project's classes/packages are simply absent from the merged report.

This appears to be because Kover's generated koverArtifact / koverArtifactJvm / koverEmptyArtifact configurations expose Gradle's default capability (group:project.name), and two projects with the same name (even under different parents/groups... in our case same group, different paths) end up with an identical capability. Confirmed via outgoingVariants: both projects report com.example:core:0.0.0-LOCAL as their Kover variants' capability.

There's a related, older, closed issue #151 where two same-named leaf modules confused Kover's report generation (fixed in 0.5.1 via #163). This looks like a different manifestation of the same root cause (project identification keyed by simple name rather than full path/some other unique identifier), but in the merge step of the current (0.7+) capability/variant-based artifact model, and it doesn't error — it silently drops data, which is worse than a build failure since nothing signals that coverage is missing.

Errors
Build succeeds; one project's coverage is silently missing from the merged report, with no error/warning anywhere.

Expected behavior
Either:

  • The merge includes both projects' coverage correctly (each keyed by full project path, not by group:name), or
  • The build fails loudly with a capability-conflict error (as Gradle's own capability-conflict documentation says it should for two components exposing the same capability in one graph), rather than silently dropping one.

Reproducer
https://github.com/Curs3W4ll/Kotlinx-Kover-project-name-collision-reproduction

Environment

  • Kover Gradle Plugin version: 0.9.9
  • Gradle version: 9.5.1
  • Kotlin project type: Kotlin/JVM
  • Coverage Toolset (if customized in build script): Kover
  • Other context important for this bug: MacOS 26.6

Activity

  1. added
    Bug
    S: untriaged
    on Aug 27, 2026
  2. added
    S: in progress
    and removed
    S: untriaged
    on Sep 14, 2026
  3. added theissue type on Sep 14, 2026
  4. added
    S: ready for release
    and removed
    S: in progress
    on Sep 18, 2026
  5. added a commit that references this issue on Sep 19, 2026
    e8caba7
  6. shanshin commented on Sep 28, 2026

    @shanshin
    Collaborator

    Fixed in 0.9.10

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

Metadata

Metadata

Assignees

Labels

BugS: ready for release

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions