1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.project;
20
21 import java.io.File;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.apache.maven.model.building.ModelProblem;
26
27
28
29
30
31 class DefaultProjectBuildingResult implements ProjectBuildingResult {
32
33 private final String projectId;
34
35 private final File pomFile;
36
37 private final MavenProject project;
38
39 private final List<ModelProblem> problems;
40
41 private final DependencyResolutionResult dependencyResolutionResult;
42
43
44
45
46
47
48
49
50 DefaultProjectBuildingResult(
51 MavenProject project, List<ModelProblem> problems, DependencyResolutionResult dependencyResolutionResult) {
52 this.projectId = (project != null)
53 ? project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion()
54 : "";
55 this.pomFile = (project != null) ? project.getFile() : null;
56 this.project = project;
57 this.problems = problems != null ? problems : Collections.emptyList();
58 this.dependencyResolutionResult = dependencyResolutionResult;
59 }
60
61
62
63
64
65
66
67
68 DefaultProjectBuildingResult(String projectId, File pomFile, List<ModelProblem> problems) {
69 this.projectId = (projectId != null) ? projectId : "";
70 this.pomFile = pomFile;
71 this.project = null;
72 this.problems = problems != null ? problems : Collections.emptyList();
73 this.dependencyResolutionResult = null;
74 }
75
76 public String getProjectId() {
77 return projectId;
78 }
79
80 public File getPomFile() {
81 return pomFile;
82 }
83
84 public MavenProject getProject() {
85 return project;
86 }
87
88 public List<ModelProblem> getProblems() {
89 return problems;
90 }
91
92 public DependencyResolutionResult getDependencyResolutionResult() {
93 return dependencyResolutionResult;
94 }
95 }