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