本文整理汇总了Java中org.apache.maven.scm.repository.ScmRepository.getProviderRepository方法的典型用法代码示例。如果您正苦于以下问题:Java ScmRepository.getProviderRepository方法的具体用法?Java ScmRepository.getProviderRepository怎么用?Java ScmRepository.getProviderRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.scm.repository.ScmRepository
的用法示例。
在下文中一共展示了ScmRepository.getProviderRepository方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderAccessBehindFirewallSection
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
/**
* 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();
}
示例2: getScmRepository
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
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;
}
示例3: renderAnonymousAccessSection
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
/**
* 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();
}
示例4: loadConnectionInfo
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
/**
* Load user name password from settings if user has not set them via JVM
* properties.
*
* @return the connection information to connect to the SCM system.
* @throws IllegalStateException if the connection string to the SCM cannot be
* fetched.
* @throws ScmRepositoryException if the repository information is not
* sufficient to build the repository instance.
* @throws NoSuchScmProviderException if there is no provider for the SCM
* connection URL.
*/
private ScmConnectionInfo loadConnectionInfo() throws IllegalStateException,
ScmRepositoryException, NoSuchScmProviderException
{
final String scmConnection = getConnection();
final ScmCredentials credentials = scmInfo.getScmCrendentials();
if (credentials.getUserName() == null || credentials.getPassword() == null)
{
final ScmRepository repository =
scmInfo.getScmManager().makeScmRepository(scmConnection);
if (repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost)
{
final ScmProviderRepositoryWithHost repositoryWithHost =
(ScmProviderRepositoryWithHost) repository.getProviderRepository();
final String host = createHostName(repositoryWithHost);
credentials.configureByServer(host);
}
}
final ScmConnectionInfo info = new ScmConnectionInfo();
info.setUserName(credentials.getUserName());
info.setPassword(credentials.getPassword());
info.setPrivateKey(credentials.getPrivateKey());
info.setScmConnectionUrl(scmConnection);
info.setTagBase(scmInfo.getTagBase());
info.setRemoteVersion(scmInfo.getRemoteVersion());
return info;
}
示例5: createRepository
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
/**
* Creates and configures the SCM repository.
*
* @param scmManager the manager to create the repository dependent on the
* {@link #getConnectionUrl() connection URL}.
* @return the repository implementation to connect to the SCM system.
* @throws ScmException if the repository implementation cannot be created or
* configured. This happens especially if no provider exists for the
* given connection URL.
*/
public ScmRepository createRepository(final ScmManager scmManager)
throws ScmException
{
try
{
final ScmRepository repository =
scmManager.makeScmRepository(connectionUrl);
final ScmProviderRepository providerRepository =
repository.getProviderRepository();
configure(providerRepository);
if (repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost)
{
final ScmProviderRepositoryWithHost providerRepositoryWithHost =
(ScmProviderRepositoryWithHost) repository.getProviderRepository();
configure(providerRepositoryWithHost);
}
if (!StringUtils.isEmpty(tagBase)
&& repository.getProvider().equals("svn"))
{
final SvnScmProviderRepository svnRepository =
(SvnScmProviderRepository) repository.getProviderRepository();
configure(svnRepository);
}
return repository;
}
catch (final Exception e)
{
throw new ScmException("The SCM provider cannot be created.", e);
}
}
示例6: renderDeveloperAccessSection
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
/**
* 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();
}
示例7: testUrl
import org.apache.maven.scm.repository.ScmRepository; //导入方法依赖的package包/类
private void testUrl( String scmUrl, String expectedUrl, String expectedUser )
throws Exception
{
ScmRepository repository = scmManager.makeScmRepository( scmUrl );
assertNotNull( "ScmManager.makeScmRepository() returned null", repository );
assertNotNull( "The provider repository was null.", repository.getProviderRepository() );
assertTrue( "The SCM Repository isn't a " + SvnScmProviderRepository.class.getName() + ".",
repository.getProviderRepository() instanceof SvnScmProviderRepository );
SvnScmProviderRepository providerRepository =
(SvnScmProviderRepository) repository.getProviderRepository();
assertEquals( "url is incorrect", expectedUrl, providerRepository.getUrl() );
assertEquals( "User is incorrect", expectedUser, providerRepository.getUser() );
}