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 2ea1892..5dc8bb9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -127,7 +127,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.0.20</version>
+      <version>3.0.23</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
diff --git a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
index 18c505c..f6659b5 100644
--- a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
+++ b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
@@ -285,7 +285,8 @@
             {
                 writer = new FileWriter( output );
                 writer.write( messages );
-                writer.flush();
+                writer.close();
+                writer = null;
             }
             finally
             {
diff --git a/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java b/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
index b9b5541..1a24734 100644
--- a/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
+++ b/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
@@ -150,6 +150,9 @@
 
                 String siteHtml = IOUtil.toString( streamReader );
 
+                streamReader.close();
+                streamReader = null;
+
                 if ( !siteHtml.contains( "href=\"index.html\"" ) )
                 {
                     reporter.error( "site.xml is missing the link to: index.html \"Introduction\"." );