fix non closing stream

This commit is contained in:
Sebastian Sdorra
2012-10-30 08:26:33 +01:00
parent 9e7e8a3f40
commit 87a518e984
2 changed files with 21 additions and 16 deletions

View File

@@ -99,9 +99,12 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
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)
@@ -124,19 +127,17 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
}
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;
@@ -219,6 +220,19 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param artifact
*
* @return
*/
protected String getId(Artifact artifact)
{
return artifact.getGroupId().concat(":").concat(artifact.getArtifactId());
}
/**
* Method description
*
@@ -358,7 +372,6 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
throws MojoExecutionException
{
String id = getId(artifact);
if (!excludeList.contains(id))
{
@@ -384,10 +397,6 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
}
}
}
protected String getId(Artifact artifact){
return artifact.getGroupId().concat(":").concat(artifact.getArtifactId());
}
/**
* Method description

View File

@@ -307,11 +307,7 @@ public class FixDescriptorMojo extends AbstractMojo
project.getDescription());
}
if (!author)
{
// ??
}
// TODO handle author node
}
/**