Closed
Description
Maël OUAHI opened SPR-15989 and commented
PathMatchingResourcePatternResolver provides duplicate resources when using "classpath*" prefix combined with Ant-style patterns.
I'll attach an application that reproduces the problem.The application uses the location pattern "classpath*:/*-perm.json" to resolve Resources.
If you package and run it
mvn clean package && java -jar target/resources-0.0.1-SNAPSHOT.jar
You should see the following output:
file:/D:/resources/target/resources-0.0.1-SNAPSHOT.jar!/
file:D:\resources\target\resources-0.0.1-SNAPSHOT.jar!/
file:/C:/Program%20Files/Java/jdk1.8.0_40/jre/lib/ext/dnsns.jar!/
...
file:/D:/resources/target/resources-0.0.1-SNAPSHOT.jar!/domaine-perm.json
file:D:\resources\target\resources-0.0.1-SNAPSHOT.jar!/domaine-perm.json
Affects: 4.3.8, 4.3.9, 4.3.10, 4.3.11
Attachments:
- resources.zip (1.04 MB)
Issue Links:
- PathMatchingResourcePatternResolver does not consider manifest based classpaths [SPR-13685] #18260 PathMatchingResourcePatternResolver does not consider manifest based classpaths
PathMatchingResourcePatternResolver
returns duplicate resources when usingclasspath*:
prefix [SPR-16117] #20665 PathMatchingResourcePatternResolver returns duplicate resources when using classpath* prefix
Referenced from: commits 9d8e3d4, a839477
Backported to: 4.3.12