1 package org.apache.maven.plugin.dependency.fromConfiguration;
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
24 import org.apache.maven.artifact.Artifact;
25 import org.apache.maven.plugin.dependency.utils.DependencyUtil;
26 import org.codehaus.plexus.util.StringUtils;
27
28
29
30
31
32
33
34
35
36 public class ArtifactItem
37 {
38
39
40
41
42
43
44 private String groupId;
45
46
47
48
49
50
51
52 private String artifactId;
53
54
55
56
57
58
59 private String version = null;
60
61
62
63
64
65
66 private String baseVersion = null;
67
68
69
70
71
72
73
74 private String type = "jar";
75
76
77
78
79
80
81 private String classifier;
82
83
84
85
86
87
88 private File outputDirectory;
89
90
91
92
93
94
95 private String destFileName;
96
97
98
99
100 private String overWrite;
101
102
103
104
105 private boolean needsProcessing;
106
107
108
109
110 private Artifact artifact;
111
112
113
114
115
116 private String includes;
117
118
119
120
121
122 private String excludes;
123
124 public ArtifactItem()
125 {
126
127 }
128
129 public ArtifactItem( Artifact artifact )
130 {
131 this.setArtifact( artifact );
132 this.setArtifactId( artifact.getArtifactId() );
133 this.setClassifier( artifact.getClassifier() );
134 this.setGroupId( artifact.getGroupId() );
135 this.setType( artifact.getType() );
136 this.setVersion( artifact.getVersion() );
137 this.setBaseVersion( artifact.getBaseVersion() );
138 }
139
140 private String filterEmptyString( String in )
141 {
142 if ( "".equals( in ) )
143 {
144 return null;
145 }
146 return in;
147 }
148
149
150
151
152 public String getArtifactId()
153 {
154 return artifactId;
155 }
156
157
158
159
160
161 public void setArtifactId( String artifact )
162 {
163 this.artifactId = filterEmptyString( artifact );
164 }
165
166
167
168
169 public String getGroupId()
170 {
171 return groupId;
172 }
173
174
175
176
177
178 public void setGroupId( String groupId )
179 {
180 this.groupId = filterEmptyString( groupId );
181 }
182
183
184
185
186 public String getType()
187 {
188 return type;
189 }
190
191
192
193
194
195 public void setType( String type )
196 {
197 this.type = filterEmptyString( type );
198 }
199
200
201
202
203 public String getVersion()
204 {
205 return version;
206 }
207
208
209
210
211
212 public void setVersion( String version )
213 {
214 this.version = filterEmptyString( version );
215 }
216
217
218
219
220 public String getBaseVersion()
221 {
222 return baseVersion;
223 }
224
225
226
227
228
229 public void setBaseVersion( String baseVersion )
230 {
231 this.baseVersion = filterEmptyString( baseVersion );
232 }
233
234
235
236
237 public String getClassifier()
238 {
239 return classifier;
240 }
241
242
243
244
245
246 public void setClassifier( String classifier )
247 {
248 this.classifier = filterEmptyString( classifier );
249 }
250
251 public String toString()
252 {
253 if ( this.classifier == null )
254 {
255 return groupId + ":" + artifactId + ":" + StringUtils.defaultString( version, "?" ) + ":" + type;
256 }
257 else
258 {
259 return groupId + ":" + artifactId + ":" + classifier + ":" + StringUtils.defaultString( version, "?" )
260 + ":" + type;
261 }
262 }
263
264
265
266
267 public File getOutputDirectory()
268 {
269 return outputDirectory;
270 }
271
272
273
274
275
276 public void setOutputDirectory( File outputDirectory )
277 {
278 this.outputDirectory = outputDirectory;
279 }
280
281
282
283
284 public String getDestFileName()
285 {
286 return destFileName;
287 }
288
289
290
291
292
293 public void setDestFileName( String destFileName )
294 {
295 this.destFileName = filterEmptyString( destFileName );
296 }
297
298
299
300
301 public boolean isNeedsProcessing()
302 {
303 return this.needsProcessing;
304 }
305
306
307
308
309
310 public void setNeedsProcessing( boolean needsProcessing )
311 {
312 this.needsProcessing = needsProcessing;
313 }
314
315
316
317
318 public String getOverWrite()
319 {
320 return this.overWrite;
321 }
322
323
324
325
326
327 public void setOverWrite( String overWrite )
328 {
329 this.overWrite = overWrite;
330 }
331
332
333
334
335 public Artifact getArtifact()
336 {
337 return this.artifact;
338 }
339
340
341
342
343
344 public void setArtifact( Artifact artifact )
345 {
346 this.artifact = artifact;
347 }
348
349
350
351
352 public String getExcludes()
353 {
354 return DependencyUtil.cleanToBeTokenizedString( this.excludes );
355 }
356
357
358
359
360 public void setExcludes( String excludes )
361 {
362 this.excludes = excludes;
363 }
364
365
366
367
368 public String getIncludes()
369 {
370 return DependencyUtil.cleanToBeTokenizedString( this.includes );
371 }
372
373
374
375
376 public void setIncludes( String includes )
377 {
378 this.includes = includes;
379 }
380 }