1 | |
package org.apache.maven.project.overlay; |
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.model.Build; |
23 | |
import org.apache.maven.model.Extension; |
24 | |
import org.apache.maven.model.Plugin; |
25 | |
import org.apache.maven.model.PluginManagement; |
26 | |
import org.apache.maven.model.Resource; |
27 | |
|
28 | |
import java.util.ArrayList; |
29 | |
import java.util.List; |
30 | |
import java.util.Map; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
public class BuildOverlay |
36 | |
extends Build |
37 | |
{ |
38 | |
|
39 | |
private final Build build; |
40 | |
|
41 | |
private List resources; |
42 | |
private List testResources; |
43 | |
|
44 | |
public BuildOverlay( Build build ) |
45 | 0 | { |
46 | 0 | if ( build == null ) |
47 | |
{ |
48 | 0 | this.build = new Build(); |
49 | |
|
50 | 0 | this.resources = new ArrayList(); |
51 | |
|
52 | 0 | this.testResources = new ArrayList(); |
53 | |
} |
54 | |
else |
55 | |
{ |
56 | 0 | this.build = build; |
57 | |
|
58 | 0 | this.resources = new ArrayList( build.getResources() ); |
59 | |
|
60 | 0 | this.testResources = new ArrayList( build.getTestResources() ); |
61 | |
} |
62 | 0 | } |
63 | |
|
64 | |
public void addExtension( Extension extension ) |
65 | |
{ |
66 | 0 | build.addExtension( extension ); |
67 | 0 | } |
68 | |
|
69 | |
public void addPlugin( Plugin plugin ) |
70 | |
{ |
71 | 0 | build.addPlugin( plugin ); |
72 | 0 | } |
73 | |
|
74 | |
public void addResource( Resource resource ) |
75 | |
{ |
76 | 0 | resources.add( resource ); |
77 | 0 | } |
78 | |
|
79 | |
public void addTestResource( Resource resource ) |
80 | |
{ |
81 | 0 | testResources.add( resource ); |
82 | 0 | } |
83 | |
|
84 | |
public boolean equals( Object obj ) |
85 | |
{ |
86 | 0 | return build.equals( obj ); |
87 | |
} |
88 | |
|
89 | |
public void flushPluginMap() |
90 | |
{ |
91 | 0 | build.flushPluginMap(); |
92 | 0 | } |
93 | |
|
94 | |
public String getDefaultGoal() |
95 | |
{ |
96 | 0 | return build.getDefaultGoal(); |
97 | |
} |
98 | |
|
99 | |
public String getDirectory() |
100 | |
{ |
101 | 0 | return build.getDirectory(); |
102 | |
} |
103 | |
|
104 | |
public List getExtensions() |
105 | |
{ |
106 | 0 | return build.getExtensions(); |
107 | |
} |
108 | |
|
109 | |
public String getFinalName() |
110 | |
{ |
111 | 0 | return build.getFinalName(); |
112 | |
} |
113 | |
|
114 | |
public String getOutputDirectory() |
115 | |
{ |
116 | 0 | return build.getOutputDirectory(); |
117 | |
} |
118 | |
|
119 | |
public PluginManagement getPluginManagement() |
120 | |
{ |
121 | 0 | return build.getPluginManagement(); |
122 | |
} |
123 | |
|
124 | |
public List getPlugins() |
125 | |
{ |
126 | 0 | return build.getPlugins(); |
127 | |
} |
128 | |
|
129 | |
public Map getPluginsAsMap() |
130 | |
{ |
131 | 0 | return build.getPluginsAsMap(); |
132 | |
} |
133 | |
|
134 | |
public List getResources() |
135 | |
{ |
136 | 0 | return resources; |
137 | |
} |
138 | |
|
139 | |
public String getScriptSourceDirectory() |
140 | |
{ |
141 | 0 | return build.getScriptSourceDirectory(); |
142 | |
} |
143 | |
|
144 | |
public String getSourceDirectory() |
145 | |
{ |
146 | 0 | return build.getSourceDirectory(); |
147 | |
} |
148 | |
|
149 | |
public String getTestOutputDirectory() |
150 | |
{ |
151 | 0 | return build.getTestOutputDirectory(); |
152 | |
} |
153 | |
|
154 | |
public List getTestResources() |
155 | |
{ |
156 | 0 | return testResources; |
157 | |
} |
158 | |
|
159 | |
public String getTestSourceDirectory() |
160 | |
{ |
161 | 0 | return build.getTestSourceDirectory(); |
162 | |
} |
163 | |
|
164 | |
public int hashCode() |
165 | |
{ |
166 | 0 | return build.hashCode(); |
167 | |
} |
168 | |
|
169 | |
public void removeExtension( Extension extension ) |
170 | |
{ |
171 | 0 | build.removeExtension( extension ); |
172 | 0 | } |
173 | |
|
174 | |
public void removePlugin( Plugin plugin ) |
175 | |
{ |
176 | 0 | build.removePlugin( plugin ); |
177 | 0 | } |
178 | |
|
179 | |
public void removeResource( Resource resource ) |
180 | |
{ |
181 | 0 | resources.remove( resource ); |
182 | 0 | } |
183 | |
|
184 | |
public void removeTestResource( Resource resource ) |
185 | |
{ |
186 | 0 | testResources.remove( resource ); |
187 | 0 | } |
188 | |
|
189 | |
public void setDefaultGoal( String defaultGoal ) |
190 | |
{ |
191 | 0 | build.setDefaultGoal( defaultGoal ); |
192 | 0 | } |
193 | |
|
194 | |
public void setDirectory( String directory ) |
195 | |
{ |
196 | 0 | build.setDirectory( directory ); |
197 | 0 | } |
198 | |
|
199 | |
public void setExtensions( List extensions ) |
200 | |
{ |
201 | 0 | build.setExtensions( extensions ); |
202 | 0 | } |
203 | |
|
204 | |
public void setFinalName( String finalName ) |
205 | |
{ |
206 | 0 | build.setFinalName( finalName ); |
207 | 0 | } |
208 | |
|
209 | |
public void setOutputDirectory( String outputDirectory ) |
210 | |
{ |
211 | 0 | build.setOutputDirectory( outputDirectory ); |
212 | 0 | } |
213 | |
|
214 | |
public void setPluginManagement( PluginManagement pluginManagement ) |
215 | |
{ |
216 | 0 | build.setPluginManagement( pluginManagement ); |
217 | 0 | } |
218 | |
|
219 | |
public void setPlugins( List plugins ) |
220 | |
{ |
221 | 0 | build.setPlugins( plugins ); |
222 | 0 | } |
223 | |
|
224 | |
public void setResources( List resources ) |
225 | |
{ |
226 | 0 | this.resources = resources; |
227 | 0 | } |
228 | |
|
229 | |
public void setScriptSourceDirectory( String scriptSourceDirectory ) |
230 | |
{ |
231 | 0 | build.setScriptSourceDirectory( scriptSourceDirectory ); |
232 | 0 | } |
233 | |
|
234 | |
public void setSourceDirectory( String sourceDirectory ) |
235 | |
{ |
236 | 0 | build.setSourceDirectory( sourceDirectory ); |
237 | 0 | } |
238 | |
|
239 | |
public void setTestOutputDirectory( String testOutputDirectory ) |
240 | |
{ |
241 | 0 | build.setTestOutputDirectory( testOutputDirectory ); |
242 | 0 | } |
243 | |
|
244 | |
public void setTestResources( List testResources ) |
245 | |
{ |
246 | 0 | this.testResources = testResources; |
247 | 0 | } |
248 | |
|
249 | |
public void setTestSourceDirectory( String testSourceDirectory ) |
250 | |
{ |
251 | 0 | build.setTestSourceDirectory( testSourceDirectory ); |
252 | 0 | } |
253 | |
|
254 | |
public String toString() |
255 | |
{ |
256 | 0 | return build.toString(); |
257 | |
} |
258 | |
|
259 | |
public void addFilter( String string ) |
260 | |
{ |
261 | 0 | build.addFilter( string ); |
262 | 0 | } |
263 | |
|
264 | |
public List getFilters() |
265 | |
{ |
266 | 0 | return build.getFilters(); |
267 | |
} |
268 | |
|
269 | |
public void removeFilter( String string ) |
270 | |
{ |
271 | 0 | build.removeFilter( string ); |
272 | 0 | } |
273 | |
|
274 | |
public void setFilters( List filters ) |
275 | |
{ |
276 | 0 | build.setFilters( filters ); |
277 | 0 | } |
278 | |
} |