class WebsterMojo extends AbstractMojo {

    void executeWebsterPlan(final @NotNull WebsterPlan.Builder builder) throws MojoFailureException {
        try {
            websterTempDirectory.mkdirs();
            final File globalRepositoryHome = Files
                    .createTempDirectory(websterTempDirectory.toPath(), "webster_repository")
                    .toFile().getAbsoluteFile();

            try {
                WebsterPlan plan = builder
                        .withGlobalSegmentStore(new File(globalRepositoryHome, "segmentstore")).build();
                plan.perform();
            } catch (Exception e) {
                throw new MojoFailureException("Failed to execute Webster plan.", e);
            } finally {
                try {
                    tempDirDeleter.tryAccept(globalRepositoryHome);
                } catch (Exception e) {
                    getLog().error("Failed to delete temp global segment store: "
                            + globalRepositoryHome.getAbsolutePath(), e);
                }
            }
        } catch (IOException e) {
            throw new MojoFailureException("Failed to create temp global segment store", e);
        }
    }

}