diff --git a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/MetaInfConfiguration.java b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/MetaInfConfiguration.java index 920decebf12..86eb52a5d56 100644 --- a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/MetaInfConfiguration.java +++ b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/MetaInfConfiguration.java @@ -720,8 +720,11 @@ public class MetaInfConfiguration extends AbstractConfiguration public Collection getTlds(URI uri) throws IOException { HashSet tlds = new HashSet<>(); - try (Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/")); - Stream stream = Files.walk(mount.root().getPath())) + Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/")); + if (_mountedResources == null) + _mountedResources = new ArrayList<>(); + _mountedResources.add(mount); + try (Stream stream = Files.walk(mount.root().getPath())) { Iterator it = stream .filter(MetaInfConfiguration::isTldFile) diff --git a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/MetaInfConfiguration.java b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/MetaInfConfiguration.java index 504e4aa1e10..771df0abe4b 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/MetaInfConfiguration.java +++ b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/MetaInfConfiguration.java @@ -713,8 +713,11 @@ public class MetaInfConfiguration extends AbstractConfiguration public Collection getTlds(URI uri) throws IOException { HashSet tlds = new HashSet<>(); - try (Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/")); - Stream stream = Files.walk(mount.root().getPath())) + Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/")); + if (_mountedResources == null) + _mountedResources = new ArrayList<>(); + _mountedResources.add(mount); + try (Stream stream = Files.walk(mount.root().getPath())) { Iterator it = stream .filter(MetaInfConfiguration::isTldFile)