Search in sources :

Example 16 with Authentication

use of org.sonatype.aether.repository.Authentication in project SSM by Intel-bigdata.

the class AbstractDependencyResolver method setProxy.

public void setProxy(URL proxyUrl, String proxyUser, String proxyPassword) {
    Authentication auth = new Authentication(proxyUser, proxyPassword);
    Proxy proxy = new Proxy(proxyUrl.getProtocol(), proxyUrl.getHost(), proxyUrl.getPort(), auth);
    synchronized (repos) {
        for (RemoteRepository repo : repos) {
            repo.setProxy(proxy);
        }
    }
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) Authentication(org.sonatype.aether.repository.Authentication) RemoteRepository(org.sonatype.aether.repository.RemoteRepository)

Example 17 with Authentication

use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.

the class AsyncRepositoryConnector method getRealm.

private Realm getRealm(RemoteRepository repository, String credentialEncoding) {
    Realm realm = null;
    Authentication a = repository.getAuthentication();
    if (a != null && a.getUsername() != null) {
        realm = new Realm.RealmBuilder().setPrincipal(a.getUsername()).setPassword(a.getPassword()).setUsePreemptiveAuth(false).setEnconding(credentialEncoding).build();
    }
    return realm;
}
Also used : Authentication(org.sonatype.aether.repository.Authentication) Realm(com.ning.http.client.Realm)

Example 18 with Authentication

use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.

the class AsyncRepositoryConnector method getProxy.

private ProxyServer getProxy(RemoteRepository repository, String credentialEncoding) {
    ProxyServer proxyServer = null;
    Proxy p = repository.getProxy();
    if (p != null) {
        Authentication a = p.getAuthentication();
        boolean useSSL = repository.getProtocol().equalsIgnoreCase("https") || repository.getProtocol().equalsIgnoreCase("dav:https");
        if (a == null) {
            proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort());
        } else {
            proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort(), a.getUsername(), a.getPassword());
            proxyServer.setEncoding(credentialEncoding);
        }
    }
    return proxyServer;
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) Authentication(org.sonatype.aether.repository.Authentication) ProxyServer(com.ning.http.client.ProxyServer)

Example 19 with Authentication

use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.

the class AuthWithNonAsciiCredentialsPutTest method before.

@Before
@Override
public void before() throws Exception {
    super.before();
    repository().setAuthentication(new Authentication("user-non-ascii", "\u00E4\u00DF"));
}
Also used : Authentication(org.sonatype.aether.repository.Authentication) Before(org.junit.Before)

Example 20 with Authentication

use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.

the class ProxyPutTest 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