Resources included as file: and jar: in tests

I have a file src/main/resources/file.txt in a sub-project yyy. The unit test code uses PathMatchingResourcePatternResolver().getResources("classpath*:file.txt") to locate the resource.
With Maven this call returned a single resource. However, with Gradle (6.6RC1 at the moment) I get two resources:

  file:/home/cotto/IdeaProjects/xxx/yyy/build/resources/main/file.txt
  jar:file:/home/cotto/IdeaProjects/xxx/yyy/build/libs/yyy-1.0.0-SNAPSHOT.jar!/file.txt

As in the GitHub issue mentioned below, the * in classpath*: is part of the problem.
Why does this file appear twice on the (test) classpath when using classpath*:?

Related: https://github.com/Activiti/Activiti/issues/2054#issuecomment-657434212

This only happens if I add the test fixtures plugin AND have an integration test source set. The problem is caused by runtimeClasspath += sourceSets.main.output from the integrationTest configuration. I’m investigating what this means. I took this straight out of https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests so this might be a bigger issue?

Related to https://github.com/gradle/gradle/issues/10872?

Raised a bug: https://github.com/gradle/gradle/issues/13781