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 08d01f0..c7a27e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.0.20</version>
+      <version>3.0.23</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index f17dd8a..f8068e8 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -267,6 +267,11 @@
                             
                             IOUtil.copy( pomInputStream, pomOutputStream );
 
+                            pomOutputStream.close();
+                            pomOutputStream = null;
+                            pomInputStream.close();
+                            pomInputStream = null;
+
                             processModel( readModel( pomFile ) );
 
                             break;
@@ -556,7 +561,10 @@
         try
         {
             reader = ReaderFactory.newXmlReader( pomFile );
-            return new MavenXpp3Reader().read( reader );
+            final Model model = new MavenXpp3Reader().read( reader );
+            reader.close();
+            reader = null;
+            return model;
         }
         catch ( FileNotFoundException e )
         {
@@ -594,8 +602,12 @@
             tempFile.deleteOnExit();
 
             fw = WriterFactory.newXmlWriter( tempFile );
+
             new MavenXpp3Writer().write( fw, model );
 
+            fw.close();
+            fw = null;
+
             return tempFile;
         }
         catch ( IOException e )