From 0986281911a7886ade8fbe09c6127e4420f7897a Mon Sep 17 00:00:00 2001 From: Jason <44935830+huyachigege@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:17:37 +0800 Subject: [PATCH] Update PathMatchingResourcePatternResolver.java --- .../core/io/support/PathMatchingResourcePatternResolver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java index 223c0529196a..6f8371f4a763 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java @@ -430,7 +430,8 @@ protected void addClassPathManifestEntries(Set result) { int prefixIndex = filePath.indexOf(':'); if (prefixIndex == 1) { // Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection - filePath = StringUtils.capitalize(filePath); + // to resolve find duplicate jar resource on windows + filePath = "/" + StringUtils.capitalize(filePath); } // # can appear in directories/filenames, java.net.URL should not treat it as a fragment filePath = StringUtils.replace(filePath, "#", "%23");