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