View Javadoc
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.apache.maven.project;
20  
21  import java.util.List;
22  
23  import org.eclipse.aether.graph.Dependency;
24  import org.eclipse.aether.graph.DependencyNode;
25  
26  /**
27   * The result of a project dependency resolution.
28   *
29   */
30  public interface DependencyResolutionResult {
31  
32      /**
33       * Gets the dependency graph of the project.
34       *
35       * @return The dependency graph or {@code null} if not available.
36       */
37      DependencyNode getDependencyGraph();
38  
39      /**
40       * Gets the transitive dependencies of the project that were not excluded by
41       * {@link DependencyResolutionRequest#getResolutionFilter()}. This list is a union of the results from
42       * {@link #getResolvedDependencies()} and {@link #getUnresolvedDependencies()}.
43       *
44       * @return The transitive dependencies, never {@code null}.
45       */
46      List<Dependency> getDependencies();
47  
48      /**
49       * Gets the dependencies that were successfully resolved.
50       *
51       * @return The resolved dependencies, never {@code null}.
52       */
53      List<Dependency> getResolvedDependencies();
54  
55      /**
56       * Gets the dependencies that could not be resolved.
57       *
58       * @return The unresolved dependencies, never {@code null}.
59       */
60      List<Dependency> getUnresolvedDependencies();
61  
62      /**
63       * Gets the errors that occurred while building the dependency graph.
64       *
65       * @return The errors that occurred while building the dependency graph, never {@code null}.
66       */
67      List<Exception> getCollectionErrors();
68  
69      /**
70       * Gets the errors that occurred while resolving the specified dependency.
71       *
72       * @param dependency The dependency for which to retrieve the errors, must not be {@code null}.
73       * @return The resolution errors for the specified dependency, never {@code null}.
74       */
75      List<Exception> getResolutionErrors(Dependency dependency);
76  }