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;
20  
21  import java.util.Collection;
22  import java.util.Set;
23  
24  import org.apache.maven.artifact.Artifact;
25  import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
26  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
27  import org.apache.maven.execution.MavenSession;
28  import org.apache.maven.project.MavenProject;
29  
30  /**
31   * @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such,
32   *             but should have been.
33   *
34   */
35  @Deprecated
36  public interface ProjectDependenciesResolver {
37  
38      /**
39       * Resolves the transitive dependencies of the specified project.
40       *
41       * @param project         The project whose dependencies should be resolved, must not be {@code null}.
42       * @param scopesToResolve The dependency scopes that should be resolved, may be {@code null}.
43       * @param session         The current build session, must not be {@code null}.
44       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
45       * @throws ArtifactResolutionException in case of resolution issue
46       * @throws ArtifactNotFoundException if an artifact is not found
47       */
48      Set<Artifact> resolve(MavenProject project, Collection<String> scopesToResolve, MavenSession session)
49              throws ArtifactResolutionException, ArtifactNotFoundException;
50  
51      /**
52       * Resolves the transitive dependencies of the specified project.
53       *
54       * @param project         The project whose dependencies should be resolved, must not be {@code null}.
55       * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}.
56       * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}.
57       * @param session         The current build session, must not be {@code null}.
58       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
59       * @throws ArtifactResolutionException in case of resolution issue
60       * @throws ArtifactNotFoundException if an artifact is not found
61       */
62      Set<Artifact> resolve(
63              MavenProject project,
64              Collection<String> scopesToCollect,
65              Collection<String> scopesToResolve,
66              MavenSession session)
67              throws ArtifactResolutionException, ArtifactNotFoundException;
68  
69      /**
70       * Resolves the transitive dependencies of the specified project.
71       *
72       * @param project            The project whose dependencies should be resolved, must not be {@code null}.
73       * @param scopesToCollect    The dependency scopes that should be collected, may be {@code null}.
74       * @param scopesToResolve    The dependency scopes that should be collected and also resolved, may be {@code null}.
75       * @param session            The current build session, must not be {@code null}.
76       * @param ignorableArtifacts Artifacts that need not be resolved
77       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
78       * @throws ArtifactResolutionException in case of resolution issue
79       * @throws ArtifactNotFoundException if an artifact is not found
80       */
81      Set<Artifact> resolve(
82              MavenProject project,
83              Collection<String> scopesToCollect,
84              Collection<String> scopesToResolve,
85              MavenSession session,
86              Set<Artifact> ignorableArtifacts)
87              throws ArtifactResolutionException, ArtifactNotFoundException;
88  
89      /**
90       * Resolves the transitive dependencies of the specified projects. Note that dependencies which can't be resolved
91       * from any repository but are present among the set of specified projects will not cause an exception. Instead,
92       * those unresolved artifacts will be returned in the result set, allowing the caller to take special care of
93       * artifacts that haven't been build yet.
94       *
95       * @param projects The projects whose dependencies should be resolved, may be {@code null}.
96       * @param scopes   The dependency scopes that should be resolved, may be {@code null}.
97       * @param session  The current build session, must not be {@code null}.
98       * @return The transitive dependencies of the specified projects that match the requested scopes, never
99       *         {@code null}.
100      * @throws ArtifactResolutionException in case of resolution issue
101      * @throws ArtifactNotFoundException if an artifact is not found
102      */
103     Set<Artifact> resolve(Collection<? extends MavenProject> projects, Collection<String> scopes, MavenSession session)
104             throws ArtifactResolutionException, ArtifactNotFoundException;
105 }