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 org.eclipse.aether.RepositorySystemSession; 22 import org.eclipse.aether.graph.DependencyFilter; 23 24 /** 25 * A request to resolve the dependencies of a project. 26 * 27 * @author Benjamin Bentmann 28 */ 29 public interface DependencyResolutionRequest { 30 31 /** 32 * Gets the project to resolve dependencies for. 33 * 34 * @return The project to resolve dependencies for or {@code null} if not set. 35 */ 36 MavenProject getMavenProject(); 37 38 /** 39 * Sets the project to resolve dependencies for. 40 * 41 * @param project The project to resolve dependencies for, may be {@code null}. 42 * @return This request for chaining, never {@code null}. 43 */ 44 DependencyResolutionRequest setMavenProject(MavenProject project); 45 46 /** 47 * Gets the filter used to exclude some dependencies from resolution. 48 * 49 * @return The filter to exclude dependencies from resolution or {@code null} to resolve all dependencies. 50 */ 51 DependencyFilter getResolutionFilter(); 52 53 /** 54 * Sets the filter used to exclude some dependencies from resolution. Note that this filter only controls the 55 * resolution/download of dependency artifacts, not the inclusion of dependency nodes in the resolved dependency 56 * graph. 57 * 58 * @param filter The filter to exclude dependencies from resolution, may be {@code null} to resolve all 59 * dependencies. 60 * @return This request for chaining, never {@code null}. 61 */ 62 DependencyResolutionRequest setResolutionFilter(DependencyFilter filter); 63 64 /** 65 * Gets the session to use for repository access. 66 * 67 * @return The repository session or {@code null} if not set. 68 */ 69 RepositorySystemSession getRepositorySession(); 70 71 /** 72 * Sets the session to use for repository access. 73 * 74 * @param repositorySession The repository session to use. 75 * @return This request for chaining, never {@code null}. 76 */ 77 DependencyResolutionRequest setRepositorySession(RepositorySystemSession repositorySession); 78 }