diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index a0a6c1cb7bc..013cdcc43ba 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -151,7 +151,8 @@ class BuildPlugin implements Plugin { /** Runs the given javascript using jjs from the jdk, and returns the output */ private static String runJavascript(Project project, String javaHome, String script) { - File tmpScript = File.createTempFile('es-gradle-tmp', '.js'); + File tmpScript = File.createTempFile('es-gradle-tmp', '.js') + tmpScript.deleteOnExit() tmpScript.setText(script, 'UTF-8') ByteArrayOutputStream output = new ByteArrayOutputStream() project.exec {