private org.apache.maven.settings.Proxy getProxy( ArtifactRepository repository, List<org.apache.maven.settings.Proxy> proxies ) { if ( proxies != null && repository.getProtocol() != null ) { for ( org.apache.maven.settings.Proxy proxy : proxies ) { if ( proxy.isActive() && repository.getProtocol().equalsIgnoreCase( proxy.getProtocol() ) ) { if ( StringUtils.isNotEmpty( proxy.getNonProxyHosts() ) ) { ProxyInfo pi = new ProxyInfo(); pi.setNonProxyHosts( proxy.getNonProxyHosts() ); org.apache.maven.wagon.repository.Repository repo = new org.apache.maven.wagon.repository.Repository( repository.getId(), repository.getUrl() ); if ( !ProxyUtils.validateNonProxyHosts( pi, repo.getHost() ) ) { return proxy; } } else { return proxy; } } } } return null; }
protected ProxyInfo getProxyInfo( String protocol, String host ) { if ( proxyInfoProvider != null ) { ProxyInfo proxyInfo = proxyInfoProvider.getProxyInfo( protocol ); if ( !ProxyUtils.validateNonProxyHosts( proxyInfo, host ) ) { return proxyInfo; } } return null; }
protected ProxyInfo getProxyInfo( String protocol, String host ) { if ( proxyInfoProvider != null ) { ProxyInfo proxyInfo = proxyInfoProvider.getProxyInfo( protocol ); if ( !ProxyUtils.validateNonProxyHosts( proxyInfo, host ) ) { return proxyInfo; } } return null; }
/** * {@link #setProxy(Proxy)} is called by {@link AbstractCatinalMojo#getManager()} after the constructor */ private void applyProxy() { if ( this.proxy != null ) { ProxyInfo proxyInfo = new ProxyInfo(); proxyInfo.setNonProxyHosts( this.proxy.getNonProxyHosts() ); if ( !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) { HttpHost proxy = new HttpHost( this.proxy.getHost(), this.proxy.getPort(), this.proxy.getProtocol() ); httpClient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy ); if ( this.proxy.getUsername() != null ) { httpClient.getCredentialsProvider().setCredentials( new AuthScope( this.proxy.getHost(), this.proxy.getPort() ), new UsernamePasswordCredentials( this.proxy.getUsername(), this.proxy.getPassword() ) ); } } } else { httpClient.getParams().removeParameter( ConnRoutePNames.DEFAULT_PROXY ); } }
&& ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )