Java Code Examples for org.apache.maven.scm.repository.ScmRepository#getProviderRepository()

The following examples show how to use org.apache.maven.scm.repository.ScmRepository#getProviderRepository() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScmRenderer.java    From maven-confluence-plugin with Apache License 2.0 6 votes vote down vote up
/**
 * Render the access from behind a firewall section
 *
 * @param devRepository the dev repository
 */
private void renderAccessBehindFirewallSection(ScmRepository devRepository) {
    startSection(getI18nString("accessbehindfirewall.title"));

    if (devRepository != null && isScmSystem(devRepository, "svn")) {
        SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) devRepository.getProviderRepository();

        paragraph(getI18nString("accessbehindfirewall.svn.intro"));

        verbatimText("$ svn checkout " + svnRepo.getUrl() + " " + checkoutDirectoryName);
    } else if (devRepository != null && isScmSystem(devRepository, "cvs")) {
        linkPatternedText(getI18nString("accessbehindfirewall.cvs.intro"));
    } else {
        paragraph(getI18nString("accessbehindfirewall.general.intro"));
    }

    endSection();
}
 
Example 2
Source File: AbstractScmMojo.java    From buildnumber-maven-plugin with MIT License 6 votes vote down vote up
protected ScmRepository getScmRepository()
    throws ScmException
{
    ScmRepository repository = scmManager.makeScmRepository( !StringUtils.isBlank( this.scmConnectionUrl )
                    ? scmConnectionUrl : scmDeveloperConnectionUrl );

    ScmProviderRepository scmRepo = repository.getProviderRepository();

    if ( scmRepo instanceof ScmProviderRepositoryWithHost )
    {
        loadInfosFromSettings( (ScmProviderRepositoryWithHost) scmRepo );
    }

    setPasswordIfNotEmpty( scmRepo, password );

    setUserIfNotEmpty( scmRepo, username );

    return repository;
}
 
Example 3
Source File: ScmRenderer.java    From maven-confluence-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * Render the anonymous access section depending the repository.
 * <p>
 * Note: ClearCase, Starteam et Perforce seems to have no anonymous access.
 * </p>
 *
 * @param anonymousRepository the anonymous repository
 */
private void renderAnonymousAccessSection(ScmRepository anonymousRepository) {
    if (isScmSystem(anonymousRepository, "clearcase") || isScmSystem(anonymousRepository, "perforce")
            || isScmSystem(anonymousRepository, "starteam") || StringUtils.isEmpty(anonymousConnection)) {
        return;
    }

    startSection(getI18nString("anonymousaccess.title"));

    if (anonymousRepository != null && isScmSystem(anonymousRepository, "cvs")) {
        CvsScmProviderRepository cvsRepo
                = (CvsScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessCVS(cvsRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "git")) {
        GitScmProviderRepository gitRepo
                = (GitScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessGit(gitRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "hg")) {
        HgScmProviderRepository hgRepo = (HgScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessMercurial(hgRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "svn")) {
        SvnScmProviderRepository svnRepo
                = (SvnScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessSubversion(svnRepo);
    } else {
        paragraph(getI18nString("anonymousaccess.general.intro"));

        verbatimText(anonymousConnection.substring(4));
    }

    endSection();
}
 
Example 4
Source File: ScmRenderer.java    From maven-confluence-plugin with Apache License 2.0 4 votes vote down vote up
/**
 * Render the developer access section
 *
 * @param devRepository the dev repository
 */
private void renderDeveloperAccessSection(ScmRepository devRepository) {
    if (StringUtils.isEmpty(devConnection)) {
        return;
    }

    startSection(getI18nString("devaccess.title"));

    if (devRepository != null && isScmSystem(devRepository, "clearcase")) {
        developerAccessClearCase();
    } else if (devRepository != null && isScmSystem(devRepository, "cvs")) {
        CvsScmProviderRepository cvsRepo = (CvsScmProviderRepository) devRepository.getProviderRepository();

        developerAccessCVS(cvsRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "git")) {
        GitScmProviderRepository gitRepo = (GitScmProviderRepository) devRepository.getProviderRepository();

        developerAccessGit(gitRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "hg")) {
        HgScmProviderRepository hgRepo = (HgScmProviderRepository) devRepository.getProviderRepository();

        developerAccessMercurial(hgRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "perforce")) {
        PerforceScmProviderRepository perforceRepo
                = (PerforceScmProviderRepository) devRepository.getProviderRepository();

        developerAccessPerforce(perforceRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "starteam")) {
        StarteamScmProviderRepository starteamRepo
                = (StarteamScmProviderRepository) devRepository.getProviderRepository();

        developerAccessStarteam(starteamRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "svn")) {
        SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) devRepository.getProviderRepository();

        developerAccessSubversion(svnRepo);
    } else {
        paragraph(getI18nString("devaccess.general.intro"));

        verbatimText(devConnection.substring(4));
    }

    endSection();
}