Additional logging now visible. HostConfiguration object wasn't being set on the http client

PR: MAVEN-402


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
bwalding
2003-04-17 13:07:03 +00:00
parent b0b08490c5
commit 76efd35886

View File

@@ -67,7 +67,7 @@ import org.apache.commons.logging.LogFactory;
/**
* Checks links which are normal URLs
* @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
* @version $Id: HTTPLinkValidator.java,v 1.6 2003/03/10 14:20:21 bwalding Exp $
* @version $Id: HTTPLinkValidator.java,v 1.7 2003/04/17 13:07:03 bwalding Exp $
*/
public class HTTPLinkValidator implements LinkValidator
{
@@ -92,18 +92,18 @@ public class HTTPLinkValidator implements LinkValidator
if (proxyHost == null)
{
proxy = false;
LOG.debug("Not using a proxy");
System.out.println("maven-linkcheck-plugin: Not using a proxy");
}
else
{
proxy = true;
this.proxyHost = proxyHost;
this.proxyPass = proxyPass;
this.proxyUser = proxyUser;
this.proxyPort = Integer.parseInt(proxyPort);
LOG.debug("Using Proxy Host:" + proxyHost);
LOG.debug("Using Proxy Port:" + proxyPort);
LOG.debug("Using Proxy User:" + proxyUser);
this.proxyUser = proxyUser;
this.proxyPass = proxyPass;
System.out.println("maven-linkcheck-plugin: Proxy Host:" + proxyHost);
System.out.println("maven-linkcheck-plugin: Proxy Port:" + proxyPort);
System.out.println("maven-linkcheck-plugin: Proxy User:" + proxyUser);
}
}
@@ -125,13 +125,14 @@ public class HTTPLinkValidator implements LinkValidator
hc.setProxy(proxyHost, proxyPort);
}
HttpState state = new HttpState();
if (proxyUser != null && proxyPass != null)
{
state.setProxyCredentials(null, new UsernamePasswordCredentials(proxyUser, proxyPass));
}
GetMethod get = new GetMethod(link);
cl.setHostConfiguration(hc);
cl.setState(state);
get.setFollowRedirects(true);