CumulativeScopeArtifactFilter resolutionScopeFilter = new CumulativeScopeArtifactFilter( scopesToResolve );
CumulativeScopeArtifactFilter collectionScopeFilter = new CumulativeScopeArtifactFilter( scopesToCollect );
collectionScopeFilter = new CumulativeScopeArtifactFilter( collectionScopeFilter, resolutionScopeFilter );
ArtifactResolutionRequest request =
new ArtifactResolutionRequest().setResolveRoot( false ).setResolveTransitively( true )
.setCollectionFilter( collectionScopeFilter ).setResolutionFilter( resolutionScopeFilter )
.setLocalRepository( session.getLocalRepository() ).setOffline( session.isOffline() )
.setForceUpdate( session.getRequest().isUpdateSnapshots() ).setCache( session.getRepositoryCache() );
request.setTransferListener( session.getRequest().getTransferListener() );
request.setServers( session.getRequest().getServers() );
request.setMirrors( session.getRequest().getMirrors() );
request.setProxies( session.getRequest().getProxies() );
for ( MavenProject project : projects )
{
request.setArtifact( new ProjectArtifact( project ) );
request.setArtifactDependencies( project.getDependencyArtifacts() );
request.setManagedVersionMap( project.getManagedVersionMap() );
request.setRemoteRepositories( project.getRemoteArtifactRepositories() );
ArtifactResolutionResult result = repositorySystem.resolve( request );
try
{