Search in sources :

Example 1 with ConservativeAuthenticationSelector

use of org.eclipse.aether.util.repository.ConservativeAuthenticationSelector in project spring-boot by spring-projects.

the class MavenSettings method createAuthenticationSelector.

private AuthenticationSelector createAuthenticationSelector(SettingsDecryptionResult decryptedSettings) {
    DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector();
    for (Server server : decryptedSettings.getServers()) {
        AuthenticationBuilder auth = new AuthenticationBuilder();
        auth.addUsername(server.getUsername()).addPassword(server.getPassword());
        auth.addPrivateKey(server.getPrivateKey(), server.getPassphrase());
        selector.add(server.getId(), auth.build());
    }
    return new ConservativeAuthenticationSelector(selector);
}
Also used : AuthenticationBuilder(org.eclipse.aether.util.repository.AuthenticationBuilder) Server(org.apache.maven.settings.Server) DefaultAuthenticationSelector(org.eclipse.aether.util.repository.DefaultAuthenticationSelector) ConservativeAuthenticationSelector(org.eclipse.aether.util.repository.ConservativeAuthenticationSelector)

Aggregations

Server (org.apache.maven.settings.Server)1 AuthenticationBuilder (org.eclipse.aether.util.repository.AuthenticationBuilder)1 ConservativeAuthenticationSelector (org.eclipse.aether.util.repository.ConservativeAuthenticationSelector)1 DefaultAuthenticationSelector (org.eclipse.aether.util.repository.DefaultAuthenticationSelector)1