/** * Creates a {@link NexusClient} for specified Nexus instance, user and password. * * @param nexus to create client for * @param userName user * @param password password * @return created nexus client. Never null. */ protected NexusClient createNexusClient(final NexusBundle nexus, final String userName, final String password) { return nexusClientFactory.createFor( baseUrlFrom(checkNotNull(nexus).getUrl()), new UsernamePasswordAuthenticationInfo(checkNotNull(userName), checkNotNull(password)) ); }
protected NexusClient getNexusClientForBaseUrl(final String baseUrlString, final SubsystemFactory<?, JerseyNexusClient>... subsystemFactories) { if (baseUrlString == null) { throw new IllegalStateException(); } BaseUrl baseUrl; try { baseUrl = BaseUrl.baseUrlFrom(sanitizeBaseurl(baseUrlString)); } catch (MalformedURLException e) { throw new RuntimeException(e); } AuthenticationInfo authenticationInfo = new UsernamePasswordAuthenticationInfo(nexus.getUsername(), nexus.getPassword()); ConnectionInfo connectionInfo = new ConnectionInfo(baseUrl, authenticationInfo, null /* proxyInfos */); return new JerseyNexusClientFactory(subsystemFactories).createFor(connectionInfo); }
log.info(" + Using server credentials \"{}\" from Maven settings.", server.getId()); authenticationInfo = new UsernamePasswordAuthenticationInfo(server.getUsername(), server.getPassword()); if (proxy.getUsername() != null) { proxyAuthentication = new UsernamePasswordAuthenticationInfo(proxy.getUsername(), proxy.getPassword());
new UsernamePasswordAuthenticationInfo(connection.getAuthentication().getUsername(), connection.getAuthentication().getPassword()); if (connection.getProxy().getAuthentication() != null) { proxyAuthentication = new UsernamePasswordAuthenticationInfo( connection.getProxy().getAuthentication().getUsername(), connection.getProxy().getAuthentication().getPassword());