Search in sources :

Example 1 with DefaultAuthenticationSelector

use of org.eclipse.aether.util.repository.DefaultAuthenticationSelector in project spring-cloud-function by spring-cloud.

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)

Example 2 with DefaultAuthenticationSelector

use of org.eclipse.aether.util.repository.DefaultAuthenticationSelector 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)2 AuthenticationBuilder (org.eclipse.aether.util.repository.AuthenticationBuilder)2 ConservativeAuthenticationSelector (org.eclipse.aether.util.repository.ConservativeAuthenticationSelector)2 DefaultAuthenticationSelector (org.eclipse.aether.util.repository.DefaultAuthenticationSelector)2