1 package org.apache.maven.shared.dependencies.resolve; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import java.util.Collection; 23 24 import org.apache.maven.model.Dependency; 25 import org.apache.maven.model.Model; 26 import org.apache.maven.project.ProjectBuildingRequest; 27 import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; 28 import org.apache.maven.shared.artifact.resolve.ArtifactResult; 29 import org.apache.maven.shared.dependencies.DependableCoordinate; 30 31 /** 32 * 33 */ 34 public interface DependencyResolver 35 { 36 /** 37 * This will resolve the dependencies of the coordinate, not resolving the the artifact of the coordinate itself. 38 * If the coordinate needs to be resolved too, use 39 * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)} passing 40 * {@code Collections.singletonList(coordinate)} 41 * 42 * @param buildingRequest {@link ProjectBuildingRequest} 43 * @param coordinate {@link DependableCoordinate} 44 * @param filter {@link TransformableFilter} 45 * @return the resolved dependencies. 46 * @throws DependencyResolverException in case of an error. 47 */ 48 Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, 49 DependableCoordinate coordinate, 50 TransformableFilter filter ) throws DependencyResolverException; 51 52 Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, 53 Model model, 54 TransformableFilter filter ) throws DependencyResolverException; 55 56 /** 57 * @param buildingRequest the project building request, never {@code null} 58 * @param dependencies the dependencies to resolve, can be {@code null} 59 * @param managedDependencies managed dependencies, can be {@code null} 60 * @param filter a filter, can be {@code null} 61 * @return the resolved dependencies. 62 * @throws DependencyResolverException in case of an error. 63 */ 64 Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, 65 Collection<Dependency> dependencies, 66 Collection<Dependency> managedDependencies, 67 TransformableFilter filter ) throws DependencyResolverException; 68 }