public Path install()

in arthur-impl/src/main/java/org/apache/geronimo/arthur/impl/nativeimage/installer/SdkmanGraalVMInstaller.java [45:81]


    public Path install() {
        Path archive;
        try {
            archive = configuration.getResolver().apply(configuration.getGav());
        } catch (final IllegalStateException ise) {
            if (configuration.isOffline()) {
                throw new IllegalStateException("GraalVM was not found and mvn runs offline");
            }
            try {
                if (!Files.exists(configuration.getWorkdir())) {
                    Files.createDirectories(configuration.getWorkdir());
                }

                log.info("Downloading GraalVM {}, this can be long", configuration.getVersion());
                final Path download = download();

                log.info("Installing GraalVM {}", configuration.getGav());
                archive = configuration.getInstaller().apply(configuration.getGav(), download);
            } catch (final IOException e) {
                throw new IllegalStateException("Can't cache graal locally", e);
            }
        }
        if (!Files.exists(archive)) {
            throw new IllegalStateException("No graal archive available: " + archive);
        }

        final Path exploded = archive.getParent().resolve("distribution_exploded");
        if (!Files.isDirectory(exploded)) {
            configuration.getExtractor().accept(archive, exploded);
        }
        home = exploded;
        // if macos
        if (Files.isDirectory(home.resolve("Contents/Home"))) {
            home = home.resolve("Contents/Home");
        }
        return home;
    }