Java Code Examples for org.eclipse.aether.util.repository.DefaultAuthenticationSelector#add()

The following examples show how to use org.eclipse.aether.util.repository.DefaultAuthenticationSelector#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MavenSettings.java    From spring-init with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 5 votes vote down vote up
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);
}