private void ifOutputDirectoryExistsDelteIt()

in src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java [655:668]


    private void ifOutputDirectoryExistsDelteIt() throws MojoExecutionException {
        if (outputDirectoryImage.exists()) {
            // Delete the output folder of JLink before we start
            // otherwise JLink will fail with a message "Error: directory already exists: ..."
            try {
                getLog().debug("Deleting existing " + outputDirectoryImage.getAbsolutePath());
                FileUtils.forceDelete(outputDirectoryImage);
            } catch (IOException e) {
                getLog().error("IOException", e);
                throw new MojoExecutionException(
                        "Failure during deletion of " + outputDirectoryImage.getAbsolutePath() + " occured.");
            }
        }
    }