public static GpgVersionParser parse()

in src/main/java/org/apache/maven/plugins/gpg/GpgVersionParser.java [57:77]


    public static GpgVersionParser parse(String executable) throws MojoExecutionException {
        Commandline cmd = new Commandline();

        if (StringUtils.isNotEmpty(executable)) {
            cmd.setExecutable(executable);
        } else {
            cmd.setExecutable("gpg" + (Os.isFamily(Os.FAMILY_WINDOWS) ? ".exe" : ""));
        }

        cmd.createArg().setValue("--version");

        GpgVersionConsumer out = new GpgVersionConsumer();

        try {
            CommandLineUtils.executeCommandLine(cmd, null, out, null);
        } catch (CommandLineException e) {
            throw new MojoExecutionException("failed to execute gpg", e);
        }

        return new GpgVersionParser(out);
    }