return selector;
}
AuthenticationSelector getAuthSelector()
{
DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector();
// Collection<String> ids = new HashSet<String>();
// for ( Authentication auth : authentications )
// {
// List<String> servers = auth.getServers();
// if ( !servers.isEmpty() )
// {
// org.eclipse.aether.repository.Authentication a = ConverterUtils.toAuthentication( auth );
// for ( String server : servers )
// {
// if ( ids.add( server ) )
// {
// selector.add( server, a );
// }
// }
// }
// }
Settings settings = getSettings();
for ( Server server : settings.getServers() )
{
AuthenticationBuilder auth = new AuthenticationBuilder();
auth.addUsername( server.getUsername() );
auth.addPassword( server.getPassword() );
auth.addPrivateKey( server.getPrivateKey(), server.getPassphrase() );
selector.add( server.getId(), auth.build() );
}
return new ConservativeAuthenticationSelector( selector );
}