From 1b507f6c65635448a51388bf4ea5880ea9946385 Mon Sep 17 00:00:00 2001 From: Melloware Date: Thu, 28 Sep 2023 07:07:49 -0400 Subject: [PATCH] Fix #516: Better error message if failed moving files (#525) * Fix #516: Better error message if failed moving files * Update deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java Co-authored-by: Andy Damevin --------- Co-authored-by: Andy Damevin --- .../quarkiverse/quinoa/deployment/QuinoaProcessor.java | 9 ++++++++- docs/modules/ROOT/pages/includes/attributes.adoc | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java index 551b00ff..e62cd8be 100644 --- a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java @@ -175,7 +175,14 @@ && isDevServerMode(configuredQuinoa.resolvedConfig())) { } final Path targetBuildDir = outputTarget.getOutputDirectory().resolve(TARGET_DIR_NAME); FileUtil.deleteDirectory(targetBuildDir); - Files.move(buildDir, targetBuildDir); + try { + Files.move(buildDir, targetBuildDir); + } catch (IOException e) { + String message = String.format( + "Error moving directory '%s -> %s'. Please make sure no files are open such as in Files Explorer or other tools.", + buildDir, targetBuildDir); + throw new IOException(message, e); + } liveReload.setContextObject(QuinoaLiveContext.class, new QuinoaLiveContext(targetBuildDir)); return new TargetDirBuildItem(targetBuildDir); } diff --git a/docs/modules/ROOT/pages/includes/attributes.adoc b/docs/modules/ROOT/pages/includes/attributes.adoc index 4d7a0050..4fc3c960 100644 --- a/docs/modules/ROOT/pages/includes/attributes.adoc +++ b/docs/modules/ROOT/pages/includes/attributes.adoc @@ -1,5 +1,5 @@ :quarkus-version: 3.2.6.Final -:quarkus-quinoa-version: 2.2.0.CR1 +:quarkus-quinoa-version: 2.2.0.CR2 :maven-version: 3.8.1+ :extension-status: stable