How to exclude third-party classes from jacoco multiproject report

I’ve followed the JaCoCo multiproject example but my aggregated report is showing classes that are provided by transitive/third-party dependencies that are not part of my project tree. How can I configure Gradle so that JaCoCo only measures test coverage of classes that are in my project and not provided as third-party libraries?

I need these dependencies as implementation dependencies, so I can’t simply change them to be compileOnly.

I’ve tried adding the following to myproject.java-conventions.gradle but it doesn’t seem to change anything:

test {
...
    jacoco {
        includes = [
            'com/myproject/**'
        ]
    }
}