}
ArtifactResolver resolver;
if ( online )
{
OnlineArtifactDownloader downloader = new OnlineArtifactDownloader( localRepository );
resolver = downloader;
if ( settings.getActiveProxy() != null )
{
Proxy proxy = settings.getActiveProxy();
downloader.setProxy( proxy.getHost(), proxy.getPort(), proxy.getUserName(), proxy.getPassword() );
}
List remoteRepos = downloader.getRemoteRepositories();
List newRemoteRepos = new ArrayList();
for ( Iterator i = remoteRepos.iterator(); i.hasNext(); )
{
Repository repo = (Repository) i.next();
boolean foundMirror = false;
for ( Iterator j = settings.getMirrors().iterator(); j.hasNext() && !foundMirror; )
{
Mirror m = (Mirror) j.next();
if ( m.getMirrorOf().equals( repo.getId() ) )
{
newRemoteRepos.add( new Repository( m.getId(), m.getUrl(), repo.getLayout(), repo.isSnapshots(),
repo.isReleases() ) );
foundMirror = true;
}
}
if ( !foundMirror )
{
newRemoteRepos.add( repo );
}
}
downloader.setRemoteRepositories( newRemoteRepos );
System.out.println( "Using the following for your local repository: " + localRepository );
System.out.println( "Using the following for your remote repository: " + newRemoteRepos );
}
else