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