--- org/apache/tomcat/util/scan/StandardJarScanner.java	2021-01-01 00:00:00.000000000 +0000
+++ org/apache/tomcat/util/scan/StandardJarScanner.java.new	2021-01-01 00:00:00.000000000 +0000
@@ -467,21 +467,26 @@
         private final String name;
 
         public ClassPathEntry(URL url) {
-            String path = url.getPath();
-            int end = path.lastIndexOf(Constants.JAR_EXT);
-            if (end != -1) {
+            String nameFromController = TomcatUtilScanControllerHandler.getTomcatController().getJarName(url);
+            if (nameFromController != null) {
+                name = nameFromController;
                 jar = true;
-                int start = path.lastIndexOf('/', end);
-                name = path.substring(start + 1, end + 4);
             } else {
-                jar = false;
-                if (path.endsWith("/")) {
-                    path = path.substring(0, path.length() - 1);
+                String path = url.getPath();
+                int end = path.lastIndexOf(Constants.JAR_EXT);
+                if (end != -1) {
+                    jar = true;
+                    int start = path.lastIndexOf('/', end);
+                    name = path.substring(start + 1, end + 4);
+                } else {
+                    jar = false;
+                    if (path.endsWith("/")) {
+                        path = path.substring(0, path.length() - 1);
+                    }
+                    int start = path.lastIndexOf('/');
+                    name = path.substring(start + 1);
                 }
-                int start = path.lastIndexOf('/');
-                name = path.substring(start + 1);
             }
-
         }
 
         public boolean isJar() {
