1 /*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15 package org.basepom.mojo.dvc;
16
17 import org.basepom.mojo.dvc.model.VersionCheckExcludes;
18
19 import java.util.List;
20
21 import org.apache.maven.project.MavenProject;
22 import org.apache.maven.project.ProjectBuilder;
23 import org.apache.maven.project.ProjectBuildingRequest;
24 import org.apache.maven.project.ProjectDependenciesResolver;
25 import org.eclipse.aether.RepositorySystem;
26 import org.eclipse.aether.RepositorySystemSession;
27 import org.eclipse.aether.artifact.Artifact;
28 import org.eclipse.aether.resolution.VersionRangeRequest;
29
30 public interface Context {
31
32 /**
33 * @return True if any unresolved system artifacts should fail the build.
34 */
35 boolean isUnresolvedSystemArtifactsFailBuild();
36
37 /**
38 * @return True if the resolver should use multiple threads.
39 */
40 boolean useFastResolution();
41
42 /**
43 * @return True if a deep scan should be performed instead of regular scan.
44 */
45 boolean useDeepScan();
46
47 /**
48 * @return True if all optional dependencies must exist.
49 */
50 boolean isOptionalDependenciesMustExist();
51
52 /**
53 * @return All configured exclusions.
54 */
55 List<VersionCheckExcludes> getExclusions();
56
57 /**
58 * @return The lookup cache for the Strategy resolution
59 */
60 StrategyCache getStrategyCache();
61
62 /**
63 * @return The Maven project builder.
64 */
65 ProjectBuilder getProjectBuilder();
66
67 /**
68 * @return The Maven project dependency resolver.
69 */
70 ProjectDependenciesResolver getProjectDependenciesResolver();
71
72 /**
73 * @return The root project.
74 */
75 MavenProject getRootProject();
76
77 /**
78 * @return All projects that are in the current reactor.
79 */
80 List<MavenProject> getReactorProjects();
81
82 /**
83 * @return The repository session
84 */
85 RepositorySystemSession getRepositorySystemSession();
86
87 /**
88 * @return The repository system for dependency resolution.
89 */
90 RepositorySystem getRepositorySystem();
91
92 /**
93 * @return A new project building request.
94 */
95 ProjectBuildingRequest createProjectBuildingRequest();
96
97 /**
98 * @param artifact The artifact to define the version range resolution request.
99 * @return A version range resolution request.
100 */
101 VersionRangeRequest createVersionRangeRequest(Artifact artifact);
102 }