From: James William Dumay Date: Mon, 17 Nov 2008 03:42:13 +0000 (+0000) Subject: MRM-1004 - RepositoryServlet tests fail intermittently on Windows. X-Git-Tag: archiva-1.2~197 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9265e9e8dda7e6374f420065201a828a4fdc8254;p=archiva.git MRM-1004 - RepositoryServlet tests fail intermittently on Windows. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@718167 13f79535-47bb-0310-9956-ffa450edef68 --- 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 74f43e0dd..d45e108a4 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 @@ -589,8 +589,18 @@ public class ArchivaDavResourceFactory { // 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(); + Model model = null; + try + { + model = new MavenXpp3Reader().read( reader ); + } + finally + { + if (reader != null) + { + reader.close(); + } + } DistributionManagement dist = model.getDistributionManagement(); if ( dist != null )