/** * Creates a request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<RemoteRepository> repositories ) { setRoot( root ); setRepositories( repositories ); }
/** * Creates a request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<RemoteRepository> repositories ) { setRoot( root ); setRepositories( repositories ); }
/** * Creates a request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<RemoteRepository> repositories ) { setRoot( root ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param dependencies The direct dependencies to merge with the direct dependencies from the root dependency's * artifact descriptor. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<Dependency> dependencies, List<RemoteRepository> repositories ) { setRoot( root ); setDependencies( dependencies ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param dependencies The direct dependencies of some imaginary root, may be {@code null}. * @param managedDependencies The dependency management information to apply to the transitive dependencies, may be * {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( List<Dependency> dependencies, List<Dependency> managedDependencies, List<RemoteRepository> repositories ) { setDependencies( dependencies ); setManagedDependencies( managedDependencies ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param dependencies The direct dependencies to merge with the direct dependencies from the root dependency's * artifact descriptor. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<Dependency> dependencies, List<RemoteRepository> repositories ) { setRoot( root ); setDependencies( dependencies ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param dependencies The direct dependencies to merge with the direct dependencies from the root dependency's * artifact descriptor. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List<Dependency> dependencies, List<RemoteRepository> repositories ) { setRoot( root ); setDependencies( dependencies ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param dependencies The direct dependencies of some imaginary root, may be {@code null}. * @param managedDependencies The dependency management information to apply to the transitive dependencies, may be * {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( List<Dependency> dependencies, List<Dependency> managedDependencies, List<RemoteRepository> repositories ) { setDependencies( dependencies ); setManagedDependencies( managedDependencies ); setRepositories( repositories ); }
/** * Creates a new request with the specified properties. * * @param dependencies The direct dependencies of some imaginary root, may be {@code null}. * @param managedDependencies The dependency management information to apply to the transitive dependencies, may be * {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( List<Dependency> dependencies, List<Dependency> managedDependencies, List<RemoteRepository> repositories ) { setDependencies( dependencies ); setManagedDependencies( managedDependencies ); setRepositories( repositories ); }
private CollectorResult collectDependencies( final ProjectBuildingRequest buildingRequest, CollectRequest request ) throws DependencyCollectorException { RepositorySystemSession session = (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession" ); @SuppressWarnings( "unchecked" ) List<RemoteRepository> aetherRepositories = (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() ); request.setRepositories( aetherRepositories ); try { return new Maven30CollectorResult( repositorySystem.collectDependencies( session, request ) ); } catch ( DependencyCollectionException e ) { throw new DependencyCollectorException( e.getMessage(), e ); } }
/** * Resolves dependencies transitively from the given jar artifact, with the specified Maven scope * (compile, runtime, and so on.) */ public DependencyResult resolveDependencies(GAV a, String scope) throws DependencyResolutionException { DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter(scope); CollectRequest collectRequest = new CollectRequest(); collectRequest.setRoot(new Dependency(new DefaultArtifact(a.toString()), JavaScopes.COMPILE)); collectRequest.setRepositories(remoteRepositories); DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, classpathFlter); return resolveDependencies(dependencyRequest); }