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