o Updated to 'plexus-utils-3.0.23'.
o Updated to stop suppressing exceptions incorrectly when closing resources.
  Most of the time the 'IOUtils.closeQuietly' methods of 'commons-io' and
  the 'IOUtil.close' method of 'plexus-utils' are used incorrectly. They
  are meant to be used in 'finally' blocks to not suppress an exception
  already thrown in the 'try' block. The documentation of the
  'IOUtils.closeQuietly' methods explicitly contains usage examples.
  As soon as 'commons-io' or 'plexus-utils' is targetted at Java 1.7, those
  methods should get deprecated and people should be told to use the
  try-with-resources statement instead.



git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1742353 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 2878086..542debd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,7 +128,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.0.22</version>
+      <version>3.0.23</version>
     </dependency>
 
     <dependency>
diff --git a/src/main/java/org/apache/maven/plugins/war/WarManifestMojo.java b/src/main/java/org/apache/maven/plugins/war/WarManifestMojo.java
index 23112d6..7d1901b 100644
--- a/src/main/java/org/apache/maven/plugins/war/WarManifestMojo.java
+++ b/src/main/java/org/apache/maven/plugins/war/WarManifestMojo.java
@@ -79,6 +79,8 @@
             Manifest mf = ma.getManifest( getSession(), getProject(), getArchive() );
             printWriter = new PrintWriter( WriterFactory.newWriter( manifestFile, WriterFactory.UTF_8 ) );
             mf.write( printWriter );
+            printWriter.close();
+            printWriter = null;
         }
         catch ( ManifestException e )
         {
diff --git a/src/main/java/org/apache/maven/plugins/war/util/WebappStructureSerializer.java b/src/main/java/org/apache/maven/plugins/war/util/WebappStructureSerializer.java
index b3e1914..2da2519 100644
--- a/src/main/java/org/apache/maven/plugins/war/util/WebappStructureSerializer.java
+++ b/src/main/java/org/apache/maven/plugins/war/util/WebappStructureSerializer.java
@@ -75,7 +75,10 @@
         try
         {
             reader = ReaderFactory.newXmlReader( file );
-            return (WebappStructure) XSTREAM.fromXML( reader );
+            final WebappStructure webappStructure = (WebappStructure) XSTREAM.fromXML( reader );
+            reader.close();
+            reader = null;
+            return webappStructure;
         }
         finally
         {
@@ -108,6 +111,8 @@
             }
             writer = WriterFactory.newXmlWriter( targetFile );
             XSTREAM.toXML( webappStructure, writer );
+            writer.close();
+            writer = null;
         }
         finally
         {