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