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