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 | 0 | private List forkedExecutions = new ArrayList(); |
49 | |
|
50 | |
private List reports; |
51 | |
|
52 | |
public MojoExecution( MojoDescriptor mojoDescriptor ) |
53 | 0 | { |
54 | 0 | this.mojoDescriptor = mojoDescriptor; |
55 | 0 | this.configuration = null; |
56 | 0 | this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal(); |
57 | 0 | } |
58 | |
|
59 | |
public MojoExecution( MojoDescriptor mojoDescriptor, String executionId ) |
60 | 0 | { |
61 | 0 | this.mojoDescriptor = mojoDescriptor; |
62 | 0 | this.executionId = executionId; |
63 | 0 | this.configuration = null; |
64 | 0 | } |
65 | |
|
66 | |
public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration ) |
67 | 0 | { |
68 | 0 | this.mojoDescriptor = mojoDescriptor; |
69 | 0 | this.configuration = configuration; |
70 | 0 | this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal(); |
71 | 0 | } |
72 | |
|
73 | |
public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration, String executionId ) |
74 | 0 | { |
75 | 0 | this.mojoDescriptor = mojoDescriptor; |
76 | 0 | this.configuration = configuration; |
77 | 0 | this.executionId = executionId; |
78 | 0 | } |
79 | |
|
80 | |
public String getExecutionId() |
81 | |
{ |
82 | 0 | return executionId; |
83 | |
} |
84 | |
|
85 | |
public MojoDescriptor getMojoDescriptor() |
86 | |
{ |
87 | 0 | return mojoDescriptor; |
88 | |
} |
89 | |
|
90 | |
public Xpp3Dom getConfiguration() |
91 | |
{ |
92 | 0 | return configuration; |
93 | |
} |
94 | |
|
95 | |
public void addMojoExecution( MojoExecution execution ) |
96 | |
{ |
97 | 0 | forkedExecutions.add( execution ); |
98 | 0 | } |
99 | |
|
100 | |
public void setReports( List reports ) |
101 | |
{ |
102 | 0 | this.reports = reports; |
103 | 0 | } |
104 | |
|
105 | |
public List getReports() |
106 | |
{ |
107 | 0 | return reports; |
108 | |
} |
109 | |
|
110 | |
public List getForkedExecutions() |
111 | |
{ |
112 | 0 | return forkedExecutions; |
113 | |
} |
114 | |
|
115 | |
public void setConfiguration( Xpp3Dom configuration ) |
116 | |
{ |
117 | 0 | this.configuration = configuration; |
118 | 0 | } |
119 | |
} |