View Javadoc
1   package org.apache.maven;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.Collection;
23  import java.util.Set;
24  
25  import org.apache.maven.artifact.Artifact;
26  import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
27  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
28  import org.apache.maven.execution.MavenSession;
29  import org.apache.maven.project.MavenProject;
30  
31  /**
32   * @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such,
33   *             but should have been.
34   * @author jvanzyl
35   *
36   */
37  @Deprecated
38  public interface ProjectDependenciesResolver
39  {
40  
41      /**
42       * Resolves the transitive dependencies of the specified project.
43       *
44       * @param project         The project whose dependencies should be resolved, must not be {@code null}.
45       * @param scopesToResolve The dependency scopes that should be resolved, may be {@code null}.
46       * @param session         The current build session, must not be {@code null}.
47       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
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       */
61      Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect,
62                             Collection<String> scopesToResolve, MavenSession session )
63          throws ArtifactResolutionException, ArtifactNotFoundException;
64  
65      /**
66       * Resolves the transitive dependencies of the specified project.
67       *
68       * @param project             The project whose dependencies should be resolved, must not be {@code null}.
69       * @param scopesToCollect     The dependency scopes that should be collected, may be {@code null}.
70       * @param scopesToResolve     The dependency scopes that should be collected and also resolved, may be {@code null}.
71       * @param session             The current build session, must not be {@code null}.
72       * @param ignoreableArtifacts Artifacts that need not be resolved
73       * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}.
74       */
75      Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect,
76                             Collection<String> scopesToResolve, MavenSession session, Set<Artifact> ignoreableArtifacts )
77          throws ArtifactResolutionException, ArtifactNotFoundException;
78  
79      /**
80       * Resolves the transitive dependencies of the specified projects. Note that dependencies which can't be resolved
81       * from any repository but are present among the set of specified projects will not cause an exception. Instead,
82       * those unresolved artifacts will be returned in the result set, allowing the caller to take special care of
83       * artifacts that haven't been build yet.
84       *
85       * @param projects The projects whose dependencies should be resolved, may be {@code null}.
86       * @param scopes   The dependency scopes that should be resolved, may be {@code null}.
87       * @param session  The current build session, must not be {@code null}.
88       * @return The transitive dependencies of the specified projects that match the requested scopes, never
89       *         {@code null}.
90       */
91      Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
92                             MavenSession session )
93          throws ArtifactResolutionException, ArtifactNotFoundException;
94  
95  }