Commits

Sebastian Sdorra committed 26aab4d

fix non closing stream

Comments (0)

Files changed (2)

maven/scm-maven-plugin/src/main/java/sonia/scm/maven/AbstractBaseScmMojo.java

     List<String> excludeList = new ArrayList<String>();
     InputStream input = null;
 
+    JarFile file = null;
+
     try
     {
-      JarFile file = new JarFile(warFile);
+      file = new JarFile(warFile);
+
       JarEntry entry = file.getJarEntry(RESOURCE_DEPENDENCY_LIST);
 
       if (entry == null)
       }
       finally
       {
-        if (scanner != null)
-        {
-          scanner.close();
-        }
+        IOUtils.closeQuietly(scanner);
       }
     }
     catch (IOException ex)
     {
-      throw new MojoExecutionException("could not read dependency file");
+      throw new MojoExecutionException("could not read dependency file", ex);
     }
     finally
     {
       IOUtils.closeQuietly(input);
+      IOUtils.closeQuietly(file);
     }
 
     return excludeList;
    * Method description
    *
    *
+   * @param artifact
+   *
+   * @return
+   */
+  protected String getId(Artifact artifact)
+  {
+    return artifact.getGroupId().concat(":").concat(artifact.getArtifactId());
+  }
+
+  /**
+   * Method description
+   *
+   *
    * @return
    */
   protected Artifact getPluginArtifact()
     throws MojoExecutionException
   {
     String id = getId(artifact);
-      
 
     if (!excludeList.contains(id))
     {
       }
     }
   }
-  
-  protected String getId(Artifact artifact){
-    return artifact.getGroupId().concat(":").concat(artifact.getArtifactId());
-  }
 
   /**
    * Method description

maven/scm-maven-plugin/src/main/java/sonia/scm/maven/FixDescriptorMojo.java

                  project.getDescription());
     }
 
-    if (!author)
-    {
-
-      // ??
-    }
+    // TODO handle author node
   }
 
   /**