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 1d65d7b..09cff9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -137,7 +137,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.shared</groupId>
diff --git a/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java b/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
index 1c78f7e..7b21613 100644
--- a/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
+++ b/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
@@ -413,6 +413,8 @@
         {
             reader = ReaderFactory.newXmlReader( pom );
             model = new MavenXpp3Reader().read( reader );
+            reader.close();
+            reader = null;
         }
         catch ( XmlPullParserException e )
         {
diff --git a/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java b/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
index c99a5bf..cb53d05 100644
--- a/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
+++ b/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
@@ -29,8 +29,8 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.Reader;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -142,24 +142,14 @@
     {
         URL resource = Thread.currentThread().getContextClassLoader().getResource( "META-INF/maven/plugin.xml" );
 
-        InputStream stream = null;
+        Reader reader = null;
         try
         {
-            stream = resource.openStream();
+            reader = new InputStreamReader( resource.openStream() );
             Xpp3Dom pluginDom;
-            try
-            {
-                pluginDom = Xpp3DomBuilder.build( new InputStreamReader( stream ) );
-            }
-            catch ( XmlPullParserException e )
-            {
-                IOException err = new IOException(
-                                                   "Failed to parse plugin descriptor for groupId:artifactId:version prefix. Reason: "
-                                                       + e.getMessage() );
-                err.initCause( e );
-
-                throw err;
-            }
+            pluginDom = Xpp3DomBuilder.build( reader );
+            reader.close();
+            reader = null;
 
             pluginArtifactId = pluginDom.getChild( "artifactId" ).getValue();
             pluginGroupId = pluginDom.getChild( "groupId" ).getValue();
@@ -167,9 +157,15 @@
 
             cliPluginPrefix = pluginGroupId + ":" + pluginArtifactId + ":" + pluginVersion + ":";
         }
+        catch ( XmlPullParserException e )
+        {
+            throw (IOException) new IOException(
+                "Failed to parse plugin descriptor for groupId:artifactId:version prefix." ).initCause( e );
+
+        }
         finally
         {
-            close( stream );
+            close( reader );
         }
     }
 }