DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession( session );
pluginSession.setDependencySelector( selector );
pluginSession.setDependencyGraphTransformer( transformer );
CollectRequest request = new CollectRequest();
request.setRequestContext( REPOSITORY_CONTEXT );
request.setRepositories( repositories );
request.setRoot( new org.eclipse.aether.graph.Dependency( pluginArtifact, null ) );
for ( Dependency dependency : plugin.getDependencies() )
{
org.eclipse.aether.graph.Dependency pluginDep =
RepositoryUtils.toDependency( dependency, session.getArtifactTypeRegistry() );
if ( !JavaScopes.SYSTEM.equals( pluginDep.getScope() ) )
{
pluginDep = pluginDep.setScope( JavaScopes.RUNTIME );
}
request.addDependency( pluginDep );
}
DependencyRequest depRequest = new DependencyRequest( request, resolutionFilter );
depRequest.setTrace( trace );
request.setTrace( RequestTrace.newChild( trace, depRequest ) );
node = repoSystem.collectDependencies( pluginSession, request ).getRoot();
if ( logger.isDebugEnabled() )
{