Skip to content

PathMatchingResourcePatternResolver provides duplicate resources when using classpath*: prefix combined with ant-style [SPR-15989] #20539

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Issue Links:

Referenced from: commits 9d8e3d4, a839477

Backported to: 4.3.12

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions