*/
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;
}