public static String getPomVersion()

in hugegraph-common/src/main/java/org/apache/hugegraph/util/VersionUtil.java [109:137]


    public static String getPomVersion() {
        String cmd = "mvn help:evaluate -Dexpression=project.version " +
                     "-q -DforceStdout";
        Process process = null;
        InputStreamReader isr = null;
        try {
            process = Runtime.getRuntime().exec(cmd);
            process.waitFor();

            isr = new InputStreamReader(process.getInputStream());
            BufferedReader br = new BufferedReader(isr);
            return br.readLine();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            if (isr != null) {
                try {
                    isr.close();
                } catch (Exception ignored) {
                    // pass
                }
            }

            // Destroy child process
            if (process != null) {
                process.destroy();
            }
        }
    }