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