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 org.eclipse.aether.RepositorySystemSession; 023import org.eclipse.aether.graph.DependencyFilter; 024 025/** 026 * A request to resolve the dependencies of a project. 027 * 028 * @author Benjamin Bentmann 029 */ 030public interface DependencyResolutionRequest 031{ 032 033 /** 034 * Gets the project to resolve dependencies for. 035 * 036 * @return The project to resolve dependencies for or {@code null} if not set. 037 */ 038 MavenProject getMavenProject(); 039 040 /** 041 * Sets the project to resolve dependencies for. 042 * 043 * @param project The project to resolve dependencies for, may be {@code null}. 044 * @return This request for chaining, never {@code null}. 045 */ 046 DependencyResolutionRequest setMavenProject( MavenProject project ); 047 048 /** 049 * Gets the filter used to exclude some dependencies from resolution. 050 * 051 * @return The filter to exclude dependencies from resolution or {@code null} to resolve all dependencies. 052 */ 053 DependencyFilter getResolutionFilter(); 054 055 /** 056 * Sets the filter used to exclude some dependencies from resolution. Note that this filter only controls the 057 * resolution/download of dependency artifacts, not the inclusion of dependency nodes in the resolved dependency 058 * graph. 059 * 060 * @param filter The filter to exclude dependencies from resolution, may be {@code null} to resolve all 061 * dependencies. 062 * @return This request for chaining, never {@code null}. 063 */ 064 DependencyResolutionRequest setResolutionFilter( DependencyFilter filter ); 065 066 /** 067 * Gets the session to use for repository access. 068 * 069 * @return The repository session or {@code null} if not set. 070 */ 071 RepositorySystemSession getRepositorySession(); 072 073 /** 074 * Sets the session to use for repository access. 075 * 076 * @param repositorySession The repository session to use. 077 * @return This request for chaining, never {@code null}. 078 */ 079 DependencyResolutionRequest setRepositorySession( RepositorySystemSession repositorySession ); 080 081}