Search in sources :

Example 6 with Authentication

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();
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) Authentication(org.sonatype.aether.repository.Authentication)

Example 7 with Authentication

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;
}
Also used : Authentication(org.sonatype.aether.repository.Authentication) AuthenticationInfo(org.apache.maven.wagon.authentication.AuthenticationInfo)

Example 8 with Authentication

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"));
}
Also used : Authentication(org.sonatype.aether.repository.Authentication) Before(org.junit.Before)

Example 9 with Authentication

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);
}
Also used : MavenRepositorySystemSession(org.apache.maven.repository.internal.MavenRepositorySystemSession) RepositorySystemSession(org.sonatype.aether.RepositorySystemSession) Authentication(org.sonatype.aether.repository.Authentication) DeployRequest(org.sonatype.aether.deployment.DeployRequest) RemoteRepository(org.sonatype.aether.repository.RemoteRepository)

Example 10 with Authentication

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);
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) Authentication(org.sonatype.aether.repository.Authentication) Before(org.junit.Before)

Aggregations

Authentication (org.sonatype.aether.repository.Authentication)20 Proxy (org.sonatype.aether.repository.Proxy)10 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)8 Before (org.junit.Before)6 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 MirrorSelector (org.sonatype.aether.repository.MirrorSelector)2 ProxyServer (com.ning.http.client.ProxyServer)1 Realm (com.ning.http.client.Realm)1 ListIterator (java.util.ListIterator)1 Properties (java.util.Properties)1 RemoteRepository (org.apache.maven.artifact.ant.RemoteRepository)1 MavenRepositorySystemSession (org.apache.maven.repository.internal.MavenRepositorySystemSession)1 AuthenticationInfo (org.apache.maven.wagon.authentication.AuthenticationInfo)1 Repository (org.apache.zeppelin.dep.Repository)1 RepositorySystemSession (org.sonatype.aether.RepositorySystemSession)1 Artifact (org.sonatype.aether.artifact.Artifact)1 CollectRequest (org.sonatype.aether.collection.CollectRequest)1 DeployRequest (org.sonatype.aether.deployment.DeployRequest)1 DependencyFilter (org.sonatype.aether.graph.DependencyFilter)1