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