public List<RemoteRepository> getRemoteRepositories(
SettingsDecrypter decrypter,
ExtensionList<RemoteRepositoryDecorator> decorators) {
List<RemoteRepository> repositories = new ArrayList<RemoteRepository>();
MavenDependencyResolverSettings resolverSettings = new MavenDependencyResolverSettings();
resolverSettings.setUseMavenCentral(true);
List<RemoteRepository> repos = resolverSettings.getRemoteRepositories();
for (RemoteRepository remoteRepository : repos) {
Server server = resolverSettings.getSettings().getServer(remoteRepository.getId());
if (server != null) {
server = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server)).getServer();
remoteRepository.setAuthentication(new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server.getPassphrase()));
}
repositories.add(decorate(remoteRepository, decorators));