mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 11:16:59 +02:00
fix non closing stream
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -307,11 +307,7 @@ public class FixDescriptorMojo extends AbstractMojo
|
||||
project.getDescription());
|
||||
}
|
||||
|
||||
if (!author)
|
||||
{
|
||||
|
||||
// ??
|
||||
}
|
||||
// TODO handle author node
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user