diff --git a/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy b/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy index 9b37b20..2c641bd 100644 --- a/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy +++ b/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy @@ -178,14 +178,13 @@ class OneJar extends Jar { File writeOneJarManifestFile(Manifest manifest) { File manifestFile = File.createTempFile("one-jar-manifest", ".mf") manifestFile.deleteOnExit() - - manifestFile.withWriter { writer -> - manifest.attributes.put("Main-Class", "com.simontuffs.onejar.Boot") - manifest.attributes.put("One-Jar-Main-Class", mainClass) - manifest.attributes.put("One-Jar-Show-Expand", showExpand) - manifest.attributes.put("One-Jar-Confirm-Expand", confirmExpand) - manifest.writeTo(writer) - } - return manifestFile + + manifest.attributes.put("Main-Class", "com.simontuffs.onejar.Boot") + manifest.attributes.put("One-Jar-Main-Class", mainClass) + manifest.attributes.put("One-Jar-Show-Expand", showExpand) + manifest.attributes.put("One-Jar-Confirm-Expand", confirmExpand) + manifest.writeTo(manifestFile.path) + + manifestFile } }