}
}
request.setRemoteRepositories(settingsRepos);
request.setSystemProperties(System.getProperties());
MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
Proxy activeProxy = settings.getActiveProxy();
if (activeProxy != null)
{
DefaultProxySelector dps = new DefaultProxySelector();
dps.add(RepositoryUtils.convertFromMavenProxy(activeProxy), activeProxy.getNonProxyHosts());
repositorySession.setProxySelector(dps);
}
repositorySession.setLocalRepositoryManager(new SimpleLocalRepositoryManager(settings.getLocalRepository()));
repositorySession.setOffline(offline);
final DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector();
final List<Mirror> mirrors = executionRequest.getMirrors();
if (mirrors != null)
{
for (Mirror mirror : mirrors)
{
mirrorSelector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(),
mirror.getMirrorOfLayouts());
}
repositorySession.setMirrorSelector(mirrorSelector);
}
DefaultAuthenticationSelector authSelector = new LazyAuthenticationSelector(mirrorSelector);
for (Server server : settings.getServers())
{
authSelector.add(
server.getId(),
new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server
.getPassphrase()));
}
repositorySession.setAuthenticationSelector(authSelector);
request.setRepositorySession(repositorySession);
request.setProcessPlugins(false);
request.setResolveDependencies(false);
return request;