use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class DefaultUpdateCheckManager method getRepoKey.
private String getRepoKey(RemoteRepository repository) {
StringBuilder buffer = new StringBuilder(128);
Proxy proxy = repository.getProxy();
if (proxy != null) {
appendAuth(buffer, proxy.getAuthentication());
buffer.append(proxy.getHost()).append(':').append(proxy.getPort()).append('>');
}
Authentication auth = repository.getAuthentication();
appendAuth(buffer, auth);
buffer.append(repository.getContentType()).append('-');
buffer.append(normalizeRepoUrl(repository.getUrl()));
return buffer.toString();
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class WagonRepositoryConnector method getAuthenticationInfo.
private AuthenticationInfo getAuthenticationInfo(RemoteRepository repository) {
AuthenticationInfo auth = null;
Authentication a = repository.getAuthentication();
if (a != null) {
auth = new AuthenticationInfo();
auth.setUserName(a.getUsername());
auth.setPassword(a.getPassword());
auth.setPrivateKey(a.getPrivateKeyFile());
auth.setPassphrase(a.getPassphrase());
}
return auth;
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class AuthPutTest method before.
@Before
@Override
public void before() throws Exception {
super.before();
repository().setAuthentication(new Authentication("user", "password"));
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class Aether method deploy.
public void deploy(Artifact artifact, Artifact pom, String remoteRepository) throws DeploymentException {
RepositorySystemSession session = newSession();
RemoteRepository nexus = new RemoteRepository("nexus", "default", remoteRepository);
Authentication authentication = new Authentication("admin", "admin123");
nexus.setAuthentication(authentication);
DeployRequest deployRequest = new DeployRequest();
deployRequest.addArtifact(artifact).addArtifact(pom);
deployRequest.setRepository(nexus);
repositorySystem.deploy(session, deployRequest);
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class ProxyGetTest method before.
@Override
@Before
public void before() throws Exception {
super.before();
Authentication auth = new Authentication("puser", "password");
Proxy proxy = new Proxy("http", "localhost", provider().getPort(), auth);
repository().setProxy(proxy);
}
Aggregations