Skip to content
Permalink
Browse files
Fix file handle leak.
  • Loading branch information
garydgregory committed May 16, 2018
1 parent ceecf0e commit b7b204cc21639062135fd14417d8eda567b70d89
Showing 1 changed file with 2 additions and 3 deletions.
@@ -176,9 +176,8 @@ private void putAttachedArtifactInSha1Map(Artifact artifact) throws MojoExecutio
* @throws MojoExecutionException if we cant write the file due to an {@link IOException}.
*/
private void logAllArtifactsInPropertiesFile() throws MojoExecutionException {
try {
File sha1PropertiesFile = new File(workingDirectory, "sha1.properties");
FileOutputStream fileWriter = new FileOutputStream(sha1PropertiesFile);
File sha1PropertiesFile = new File(workingDirectory, "sha1.properties");
try (FileOutputStream fileWriter = new FileOutputStream(sha1PropertiesFile)) {
artifactSha1s.store(fileWriter, "release sha1s");
} catch (IOException e) {
throw new MojoExecutionException("Failure to write sha1's", e);

0 comments on commit b7b204c

Please sign in to comment.