private static int parseMajor(String s) {
        try {
            int major = Integer.parseInt(s);
            if (major < 1) throw new IllegalArgumentException("Major version must be positive, got " + major);
            return major;
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Invalid major version '" + s + "'", e);
        }
    }
Returns the major version declared in given deploymentXml, if any
vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/CompileVersionMojo.java