mirror of
https://github.com/apache/archiva.git
synced 2025-02-21 17:35:19 +00:00
add proxy logging in debug mode
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@680917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
18ae4a35cb
commit
28c3b26be0
@ -980,32 +980,48 @@ private boolean connectToRepository( ProxyConnector connector, Wagon wagon,
|
||||
{
|
||||
networkProxy = (ProxyInfo) this.networkProxyMap.get( connector.getProxyId() );
|
||||
}
|
||||
|
||||
if ( log.isDebugEnabled() )
|
||||
{
|
||||
if ( networkProxy != null )
|
||||
{
|
||||
// TODO: move to proxyInfo.toString()
|
||||
String msg =
|
||||
"Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
|
||||
+ " to connect to remote repository " + remoteRepository.getURL();
|
||||
if ( networkProxy.getNonProxyHosts() != null )
|
||||
{
|
||||
msg += "; excluding hosts: " + networkProxy.getNonProxyHosts();
|
||||
}
|
||||
if ( StringUtils.isNotBlank( networkProxy.getUserName() ) )
|
||||
{
|
||||
msg += "; as user: " + networkProxy.getUserName();
|
||||
}
|
||||
log.debug( msg );
|
||||
}
|
||||
}
|
||||
|
||||
AuthenticationInfo authInfo = null;
|
||||
String username = remoteRepository.getRepository().getUsername();
|
||||
String password = remoteRepository.getRepository().getPassword();
|
||||
|
||||
if ( StringUtils.isNotBlank( username ) && StringUtils.isNotBlank( password ) )
|
||||
{
|
||||
log.debug( "Using username " + username + " to connect to remote repository "
|
||||
+ remoteRepository.getURL() );
|
||||
authInfo = new AuthenticationInfo();
|
||||
authInfo.setUserName( username );
|
||||
authInfo.setPassword( password );
|
||||
}
|
||||
|
||||
//Convert seconds to milliseconds
|
||||
int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000;
|
||||
|
||||
//Set timeout
|
||||
wagon.setTimeout(timeoutInMilliseconds);
|
||||
|
||||
try
|
||||
{
|
||||
AuthenticationInfo authInfo = null;
|
||||
String username = remoteRepository.getRepository().getUsername();
|
||||
String password = remoteRepository.getRepository().getPassword();
|
||||
|
||||
if ( StringUtils.isNotBlank( username ) && StringUtils.isNotBlank( password ) )
|
||||
{
|
||||
log.debug( "Using username " + username + " to connect to remote repository "
|
||||
+ remoteRepository.getURL() );
|
||||
authInfo = new AuthenticationInfo();
|
||||
authInfo.setUserName( username );
|
||||
authInfo.setPassword( password );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug( "No authentication for remote repository needed" );
|
||||
}
|
||||
|
||||
//Convert seconds to milliseconds
|
||||
int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000;
|
||||
|
||||
//Set timeout
|
||||
wagon.setTimeout(timeoutInMilliseconds);
|
||||
|
||||
Repository wagonRepository = new Repository( remoteRepository.getId(), remoteRepository.getURL().toString() );
|
||||
wagon.connect( wagonRepository, authInfo, networkProxy );
|
||||
connected = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user