1 package org.apache.maven.plugin;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.plugin.descriptor.MojoDescriptor;
23 import org.codehaus.plexus.util.xml.Xpp3Dom;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28
29
30
31
32
33
34 public class MojoExecution
35 {
36 public static final String DEFAULT_EXEC_ID_PREFIX = "default-";
37
38 public static final String CLI_EXECUTION_ID = DEFAULT_EXEC_ID_PREFIX + "cli";
39
40
41
42 private final String executionId;
43
44 private final MojoDescriptor mojoDescriptor;
45
46 private Xpp3Dom configuration;
47
48 private List forkedExecutions = new ArrayList();
49
50 private List reports;
51
52 public MojoExecution( MojoDescriptor mojoDescriptor )
53 {
54 this.mojoDescriptor = mojoDescriptor;
55 this.configuration = null;
56 this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal();
57 }
58
59 public MojoExecution( MojoDescriptor mojoDescriptor, String executionId )
60 {
61 this.mojoDescriptor = mojoDescriptor;
62 this.executionId = executionId;
63 this.configuration = null;
64 }
65
66 public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration )
67 {
68 this.mojoDescriptor = mojoDescriptor;
69 this.configuration = configuration;
70 this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal();
71 }
72
73 public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration, String executionId )
74 {
75 this.mojoDescriptor = mojoDescriptor;
76 this.configuration = configuration;
77 this.executionId = executionId;
78 }
79
80 public String getExecutionId()
81 {
82 return executionId;
83 }
84
85 public MojoDescriptor getMojoDescriptor()
86 {
87 return mojoDescriptor;
88 }
89
90 public Xpp3Dom getConfiguration()
91 {
92 return configuration;
93 }
94
95 public void addMojoExecution( MojoExecution execution )
96 {
97 forkedExecutions.add( execution );
98 }
99
100 public void setReports( List reports )
101 {
102 this.reports = reports;
103 }
104
105 public List getReports()
106 {
107 return reports;
108 }
109
110 public List getForkedExecutions()
111 {
112 return forkedExecutions;
113 }
114
115 public void setConfiguration( Xpp3Dom configuration )
116 {
117 this.configuration = configuration;
118 }
119 }