diff --git a/core/src/main/java/io/mvnpm/esbuild/Execute.java b/core/src/main/java/io/mvnpm/esbuild/Execute.java index 28a253e0..31f4c4c2 100644 --- a/core/src/main/java/io/mvnpm/esbuild/Execute.java +++ b/core/src/main/java/io/mvnpm/esbuild/Execute.java @@ -87,7 +87,6 @@ public void close() throws IOException { process.waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new RuntimeException(e); } if (latch.getCount() == 1) { latch.countDown(); @@ -105,10 +104,12 @@ public void close() throws IOException { } }, r -> { try { - process.waitFor(); + if (process.isAlive()) { + process.destroyForcibly(); + process.waitFor(); + } } catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new RuntimeException(e); } if (latch.getCount() == 1) { result.set(r);