1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.eclipse.aether.impl;
20
21 import org.eclipse.aether.RepositorySystem;
22 import org.eclipse.aether.RepositorySystemSession;
23 import org.eclipse.aether.collection.CollectRequest;
24 import org.eclipse.aether.collection.CollectResult;
25 import org.eclipse.aether.collection.DependencyCollectionException;
26
27 /**
28 * Given a collection of direct dependencies, recursively gathers their transitive dependencies and calculates the
29 * dependency graph.
30 *
31 * @noimplement This interface is not intended to be implemented by clients.
32 * @noextend This interface is not intended to be extended by clients.
33 * @provisional This type is provisional and can be changed, moved or removed without prior notice.
34 */
35 public interface DependencyCollector {
36
37 /**
38 * Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
39 * only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the
40 * artifact files. The supplied session carries various hooks to customize the dependency graph that must be invoked
41 * throughout the operation.
42 *
43 * @param session The repository session, must not be {@code null}.
44 * @param request The collection request, must not be {@code null}.
45 * @return The collection result, never {@code null}.
46 * @throws DependencyCollectionException If the dependency tree could not be built.
47 * @see RepositorySystemSession#getDependencyTraverser()
48 * @see RepositorySystemSession#getDependencyManager()
49 * @see RepositorySystemSession#getDependencySelector()
50 * @see RepositorySystemSession#getVersionFilter()
51 * @see RepositorySystemSession#getDependencyGraphTransformer()
52 * @see RepositorySystem#collectDependencies(RepositorySystemSession, CollectRequest)
53 */
54 CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)
55 throws DependencyCollectionException;
56 }