public ScmVersion getScmVersion()

in maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java [408:430]


    public ScmVersion getScmVersion(String versionType, String version) throws MojoExecutionException {
        if ((versionType == null || versionType.isEmpty()) && (version != null && !version.isEmpty())) {
            throw new MojoExecutionException("You must specify the version type.");
        }

        if (version == null || version.isEmpty()) {
            return null;
        }

        if (VERSION_TYPE_BRANCH.equals(versionType)) {
            return new ScmBranch(version);
        }

        if (VERSION_TYPE_TAG.equals(versionType)) {
            return new ScmTag(version);
        }

        if (VERSION_TYPE_REVISION.equals(versionType)) {
            return new ScmRevision(version);
        }

        throw new MojoExecutionException("Unknown '" + versionType + "' version type.");
    }