import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.StringUtils;
import java.io.File;
* @plexus.component instantiation-strategy="per-lookup"
*/
public class DefaultProxyManager
+ extends AbstractLogEnabled
implements ProxyManager
{
/**
}
else
{
- repositoryPath = repositoryPath.substring( proxyGroup.getManagedRepository().getId().length() + 2 );
+ String id = proxyGroup.getManagedRepository().getId();
+ getLogger().debug( "requesting " + repositoryPath + " from repository '" + id + "'" );
+ repositoryPath = repositoryPath.substring( id.length() + 2 );
}
return requestHandler.get( repositoryPath, proxyGroup.getProxiedRepositories(),
artifactPath = path.substring( 0, index );
}
+ String msg = "";
+
// Request for artifact: parse the requested path to build an Artifact.
Artifact artifact = null;
try
{
artifact = defaultArtifactDiscoverer.buildArtifact( artifactPath );
+ getLogger().debug( "Artifact requested is: " + artifact );
}
catch ( DiscovererException e )
{
- getLogger().debug( "Failed to build artifact using default layout with message: " + e.getMessage() );
+ msg = "Failed to build artifact from path:\n\tfrom default: " + e.getMessage();
}
if ( artifact == null )
try
{
artifact = legacyArtifactDiscoverer.buildArtifact( artifactPath );
+ getLogger().debug( "Artifact requested is: " + artifact );
}
catch ( DiscovererException e )
{
- getLogger().debug( "Failed to build artifact using legacy layout with message: " + e.getMessage() );
+ getLogger().debug( msg + "\n\tfrom legacy: " + e.getMessage() );
}
}
{
tries++;
- getLogger().debug( "Trying " + path + " from " + repository.getName() + "..." );
-
boolean downloaded = true;
if ( force || !target.exists() )
{
+ getLogger().debug( "Retrieving " + path + " from " + repository.getName() );
wagon.get( path, temp );
}
else
{
+ getLogger().debug( "Retrieving " + path + " from " + repository.getName() + " if updated" );
downloaded = wagon.getIfNewer( path, temp, target.lastModified() );
}
{
moveTempToTarget( temp, target );
}
+
+ getLogger().debug( "Successfully downloaded" );
}
//try next repository
}