From 7feb3eb52539d4c7ca5a819d59fe8104079a9bf4 Mon Sep 17 00:00:00 2001 From: James William Dumay Date: Mon, 17 Nov 2008 01:39:20 +0000 Subject: [PATCH] MRM-1004 - RepositoryServlet tests fail intermittently on Windows. Submitted by Martin Cooper. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@718157 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/webdav/ArchivaDavResourceFactory.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 1abf8242d..74f43e0dd 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -587,7 +587,11 @@ public class ArchivaDavResourceFactory try { - Model model = new MavenXpp3Reader().read( new FileReader( pom ) ); + // MavenXpp3Reader leaves the file open, so we need to close it ourselves. + FileReader reader = new FileReader( pom ); + Model model = new MavenXpp3Reader().read( reader ); + reader.close(); + DistributionManagement dist = model.getDistributionManagement(); if ( dist != null ) { -- 2.39.5