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.ArrayList;
23 import java.util.List;
24
25 import org.apache.maven.model.building.ModelProblem;
26
27
28
29
30
31
32 class DefaultProjectBuildingResult implements ProjectBuildingResult {
33
34 private String projectId;
35
36 private File pomFile;
37
38 private MavenProject project;
39
40 private List<ModelProblem> problems;
41
42 private DependencyResolutionResult dependencyResolutionResult;
43
44
45
46
47
48
49
50
51 DefaultProjectBuildingResult(
52 MavenProject project, List<ModelProblem> problems, DependencyResolutionResult dependencyResolutionResult) {
53 this.projectId = (project != null)
54 ? project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion()
55 : "";
56 this.pomFile = (project != null) ? project.getFile() : null;
57 this.project = project;
58 this.problems = problems;
59 this.dependencyResolutionResult = dependencyResolutionResult;
60 }
61
62
63
64
65
66
67
68
69 DefaultProjectBuildingResult(String projectId, File pomFile, List<ModelProblem> problems) {
70 this.projectId = (projectId != null) ? projectId : "";
71 this.pomFile = pomFile;
72 this.problems = problems;
73 }
74
75 public String getProjectId() {
76 return projectId;
77 }
78
79 public File getPomFile() {
80 return pomFile;
81 }
82
83 public MavenProject getProject() {
84 return project;
85 }
86
87 public List<ModelProblem> getProblems() {
88 if (problems == null) {
89 problems = new ArrayList<>();
90 }
91
92 return problems;
93 }
94
95 public DependencyResolutionResult getDependencyResolutionResult() {
96 return dependencyResolutionResult;
97 }
98 }