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   * @author jvanzyl
34   *
35   */
36  @Deprecated
37  public interface ProjectDependenciesResolver {
38  
39      /**
40       * Resolves the transitive dependencies of the specified project.
41       *
42       * @param project         The project whose dependencies should be resolved, must not be {@code null}.
43       * @param scopesToResolve The dependency scopes that should be resolved, may be {@code null}.
44       * @param session         The current build session, must not be {@code null}.
45       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
46       */
47      Set<Artifact> resolve(MavenProject project, Collection<String> scopesToResolve, MavenSession session)
48              throws ArtifactResolutionException, ArtifactNotFoundException;
49  
50      /**
51       * Resolves the transitive dependencies of the specified project.
52       *
53       * @param project         The project whose dependencies should be resolved, must not be {@code null}.
54       * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}.
55       * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}.
56       * @param session         The current build session, must not be {@code null}.
57       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
58       */
59      Set<Artifact> resolve(
60              MavenProject project,
61              Collection<String> scopesToCollect,
62              Collection<String> scopesToResolve,
63              MavenSession session)
64              throws ArtifactResolutionException, ArtifactNotFoundException;
65  
66      /**
67       * Resolves the transitive dependencies of the specified project.
68       *
69       * @param project             The project whose dependencies should be resolved, must not be {@code null}.
70       * @param scopesToCollect     The dependency scopes that should be collected, may be {@code null}.
71       * @param scopesToResolve     The dependency scopes that should be collected and also resolved, may be {@code null}.
72       * @param session             The current build session, must not be {@code null}.
73       * @param ignoreableArtifacts Artifacts that need not be resolved
74       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
75       */
76      Set<Artifact> resolve(
77              MavenProject project,
78              Collection<String> scopesToCollect,
79              Collection<String> scopesToResolve,
80              MavenSession session,
81              Set<Artifact> ignoreableArtifacts)
82              throws ArtifactResolutionException, ArtifactNotFoundException;
83  
84      /**
85       * Resolves the transitive dependencies of the specified projects. Note that dependencies which can't be resolved
86       * from any repository but are present among the set of specified projects will not cause an exception. Instead,
87       * those unresolved artifacts will be returned in the result set, allowing the caller to take special care of
88       * artifacts that haven't been build yet.
89       *
90       * @param projects The projects whose dependencies should be resolved, may be {@code null}.
91       * @param scopes   The dependency scopes that should be resolved, may be {@code null}.
92       * @param session  The current build session, must not be {@code null}.
93       * @return The transitive dependencies of the specified projects that match the requested scopes, never
94       *         {@code null}.
95       */
96      Set<Artifact> resolve(Collection<? extends MavenProject> projects, Collection<String> scopes, MavenSession session)
97              throws ArtifactResolutionException, ArtifactNotFoundException;
98  }