001package org.apache.maven.project;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import java.util.List;
023
024import org.eclipse.aether.graph.Dependency;
025import org.eclipse.aether.graph.DependencyNode;
026
027/**
028 * The result of a project dependency resolution.
029 *
030 * @author Benjamin Bentmann
031 */
032public interface DependencyResolutionResult
033{
034
035    /**
036     * Gets the dependency graph of the project.
037     *
038     * @return The dependency graph or {@code null} if not available.
039     */
040    DependencyNode getDependencyGraph();
041
042    /**
043     * Gets the transitive dependencies of the project that were not excluded by
044     * {@link DependencyResolutionRequest#getResolutionFilter()}. This list is a union of the results from
045     * {@link #getResolvedDependencies()} and {@link #getUnresolvedDependencies()}.
046     *
047     * @return The transitive dependencies, never {@code null}.
048     */
049    List<Dependency> getDependencies();
050
051    /**
052     * Gets the dependencies that were successfully resolved.
053     *
054     * @return The resolved dependencies, never {@code null}.
055     */
056    List<Dependency> getResolvedDependencies();
057
058    /**
059     * Gets the dependencies that could not be resolved.
060     *
061     * @return The unresolved dependencies, never {@code null}.
062     */
063    List<Dependency> getUnresolvedDependencies();
064
065    /**
066     * Gets the errors that occurred while building the dependency graph.
067     *
068     * @return The errors that occurred while building the dependency graph, never {@code null}.
069     */
070    List<Exception> getCollectionErrors();
071
072    /**
073     * Gets the errors that occurred while resolving the specified dependency.
074     *
075     * @param dependency The dependency for which to retrieve the errors, must not be {@code null}.
076     * @return The resolution errors for the specified dependency, never {@code null}.
077     */
078    List<Exception> getResolutionErrors( Dependency dependency );
079
080}