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
32 class DefaultProjectBuildingResult implements ProjectBuildingResult {
33
34 private final String projectId;
35
36 private final File pomFile;
37
38 private final MavenProject project;
39
40 private final List<ModelProblem> problems;
41
42 private final 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 != null ? problems : Collections.emptyList();
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.project = null;
73 this.problems = problems != null ? problems : Collections.emptyList();
74 this.dependencyResolutionResult = null;
75 }
76
77 public String getProjectId() {
78 return projectId;
79 }
80
81 public File getPomFile() {
82 return pomFile;
83 }
84
85 public MavenProject getProject() {
86 return project;
87 }
88
89 public List<ModelProblem> getProblems() {
90 return problems;
91 }
92
93 public DependencyResolutionResult getDependencyResolutionResult() {
94 return dependencyResolutionResult;
95 }
96 }