use of org.apache.maven.wagon.proxy.ProxyInfoProvider in project sonatype-aether by sonatype.
the class WagonRepositoryConnector method getProxy.
private ProxyInfoProvider getProxy(RemoteRepository repository) {
ProxyInfoProvider proxy = null;
Proxy p = repository.getProxy();
if (p != null) {
final ProxyInfo prox = new ProxyInfo();
prox.setType(p.getType());
prox.setHost(p.getHost());
prox.setPort(p.getPort());
if (p.getAuthentication() != null) {
prox.setUserName(p.getAuthentication().getUsername());
prox.setPassword(p.getAuthentication().getPassword());
}
proxy = new ProxyInfoProvider() {
public ProxyInfo getProxyInfo(String protocol) {
return prox;
}
};
}
return proxy;
}
Aggregations