use of org.apache.maven.scm.provider.ScmProviderRepositoryWithHost in project maven-plugins by apache.
the class ChangeLogReport method getScmRepository.
public ScmRepository getScmRepository() throws ScmException {
ScmRepository repository;
try {
repository = manager.makeScmRepository(getConnection());
ScmProviderRepository providerRepo = repository.getProviderRepository();
if (!StringUtils.isEmpty(username)) {
providerRepo.setUser(username);
}
if (!StringUtils.isEmpty(password)) {
providerRepo.setPassword(password);
}
if (repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost) {
ScmProviderRepositoryWithHost repo = (ScmProviderRepositoryWithHost) repository.getProviderRepository();
loadInfosFromSettings(repo);
if (!StringUtils.isEmpty(username)) {
repo.setUser(username);
}
if (!StringUtils.isEmpty(password)) {
repo.setPassword(password);
}
if (!StringUtils.isEmpty(privateKey)) {
repo.setPrivateKey(privateKey);
}
if (!StringUtils.isEmpty(passphrase)) {
repo.setPassphrase(passphrase);
}
}
if (!StringUtils.isEmpty(tagBase) && repository.getProvider().equals("svn")) {
SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) repository.getProviderRepository();
svnRepo.setTagBase(tagBase);
}
} catch (Exception e) {
throw new ScmException("Can't load the scm provider.", e);
}
return repository;
}
Aggregations