Skip to content

PathMatchingResourcePatternResolver does not consider manifest based classpaths [SPR-13685] #18260

Closed
@spring-projects-issues

Description

@spring-projects-issues

Phil Webb opened SPR-13685 and commented

The PathMatchingResourcePatternResolver has a addAllClassLoaderJarRoots method which is used to find jar files on the classpath. The current implementation uses URLClassLoader.getURLs() to find items.

Unfortunately, it appears that URLClassLoader.getURLs() doesn't include elements that were added to the classpath in META-INF/MANIFEST.MF but not passed to java -cp. As Maven uses this technique to launch tests, it's pretty easy to get into a situation where tests fail but production code works.

This bug was originally raised in spring-projects/spring-boot#4438 and a repro project is included https://github.com/MichaelF25/spring-boot-messagesource-bug


Affects: 4.2.2

Issue Links:

Referenced from: commits 08748ec

0 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions