/** * Returns the default {@link Authentication} as configured in the maven settings.xml * * @return */ public static AuthenticationSelector getAuthSelector() { DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector(); Settings settings = getSettings(); for (Server server : settings.getServers()) { // Need to decode username/password because it may contain encoded characters (http://www.w3schools.com/tags/ref_urlencode.asp) // A common encoding is to provide a username as an email address like user%40domain.org String decodedUsername = decode(server.getUsername()); Authentication auth = new Authentication(decodedUsername, server.getPassword(), server.getPrivateKey(), server.getPassphrase()); selector.add(server.getId(), auth); } return new ConservativeAuthenticationSelector(selector); }
/** * Returns the default {@link Authentication} as configured in the maven settings.xml * * @return */ public static AuthenticationSelector getAuthSelector() { DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector(); Settings settings = getSettings(); for (Server server : settings.getServers()) { // Need to decode username/password because it may contain encoded characters (http://www.w3schools.com/tags/ref_urlencode.asp) // A common encoding is to provide a username as an email address like user%40domain.org String decodedUsername = decode(server.getUsername()); Authentication auth = new Authentication(decodedUsername, server.getPassword(), server.getPrivateKey(), server.getPassphrase()); selector.add(server.getId(), auth); } return new ConservativeAuthenticationSelector(selector); }
String decodedUsername = decode(server.getUsername()); Authentication authentication = new Authentication(decodedUsername, server.getPassword(), server.getPrivateKey(), server.getPassphrase()); remote.setAuthentication(authentication);
String decodedUsername = decode(server.getUsername()); Authentication authentication = new Authentication(decodedUsername, server.getPassword(), server.getPrivateKey(), server.getPassphrase()); remote.setAuthentication(authentication);