1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.eclipse.writers;
20
21 import java.io.File;
22 import java.util.Arrays;
23 import java.util.Comparator;
24 import java.util.List;
25 import java.util.Map;
26
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28 import org.apache.maven.plugin.eclipse.EclipsePlugin;
29 import org.apache.maven.plugin.eclipse.EclipseSourceDir;
30 import org.apache.maven.plugin.ide.IdeDependency;
31 import org.apache.maven.project.MavenProject;
32
33
34
35
36
37 public class EclipseWriterConfig
38 {
39
40
41
42 private MavenProject project;
43
44
45
46
47 private String packaging;
48
49
50
51
52 private File eclipseProjectDirectory;
53
54
55
56
57 private String eclipseProjectName;
58
59
60
61
62 private File projectBaseDir;
63
64
65
66
67 private IdeDependency[] deps = new IdeDependency[0];
68
69
70
71
72 private IdeDependency[] orderedDeps = new IdeDependency[0];
73
74
75
76
77 private EclipseSourceDir[] sourceDirs;
78
79
80
81
82 private ArtifactRepository localRepository;
83
84
85
86
87 private File buildOutputDirectory;
88
89
90
91
92 private File manifestFile;
93
94
95
96
97 private boolean pde;
98
99
100
101
102 private List projectnatures;
103
104
105
106
107 private Map projectFacets;
108
109
110
111
112 private List buildCommands;
113
114
115
116
117 private List classpathContainers;
118
119
120
121
122
123
124 private boolean addVersionToProjectName;
125
126
127
128
129 private String projectNameTemplate;
130
131
132
133
134
135 private String contextName;
136
137
138
139
140 private boolean wtpapplicationxml;
141
142
143
144
145 private float wtpVersion;
146
147
148
149
150
151
152 public IdeDependency[] getDeps()
153 {
154 return this.deps;
155 }
156
157
158
159
160
161
162 public void setDeps( IdeDependency[] deps )
163 {
164 this.deps = deps;
165 if ( deps != null )
166 {
167
168
169
170 Comparator depsByArtifactId = new Comparator()
171 {
172 public int compare( Object o1, Object o2 )
173 {
174 return ( (IdeDependency) o1 ).getArtifactId().compareToIgnoreCase(
175 ( (IdeDependency) o2 ).getArtifactId() );
176 }
177 };
178
179 orderedDeps = new IdeDependency[deps.length];
180 System.arraycopy( deps, 0, orderedDeps, 0, deps.length );
181 Arrays.sort( orderedDeps, depsByArtifactId );
182 }
183 }
184
185
186
187
188
189
190 public File getEclipseProjectDirectory()
191 {
192 return this.eclipseProjectDirectory;
193 }
194
195
196
197
198
199
200 public void setEclipseProjectDirectory( File eclipseProjectDir )
201 {
202 this.eclipseProjectDirectory = eclipseProjectDir;
203 }
204
205
206
207
208
209
210 public String getEclipseProjectName()
211 {
212 return eclipseProjectName;
213 }
214
215
216
217
218
219
220 public void setEclipseProjectName( String eclipseProjectName )
221 {
222 this.eclipseProjectName = eclipseProjectName;
223 }
224
225
226
227
228
229
230 public MavenProject getProject()
231 {
232 return this.project;
233 }
234
235
236
237
238
239
240 public void setProject( MavenProject project )
241 {
242 this.project = project;
243 }
244
245
246
247
248
249
250 public EclipseSourceDir[] getSourceDirs()
251 {
252 return this.sourceDirs;
253 }
254
255
256
257
258
259
260 public void setSourceDirs( EclipseSourceDir[] sourceDirs )
261 {
262 this.sourceDirs = sourceDirs;
263 }
264
265
266
267
268
269
270 public File getBuildOutputDirectory()
271 {
272 return this.buildOutputDirectory;
273 }
274
275
276
277
278
279
280 public void setBuildOutputDirectory( File buildOutputDirectory )
281 {
282 this.buildOutputDirectory = buildOutputDirectory;
283 }
284
285
286
287
288
289
290 public ArtifactRepository getLocalRepository()
291 {
292 return this.localRepository;
293 }
294
295
296
297
298
299
300 public void setLocalRepository( ArtifactRepository localRepository )
301 {
302 this.localRepository = localRepository;
303 }
304
305
306
307
308
309
310 public File getManifestFile()
311 {
312 return this.manifestFile;
313 }
314
315
316
317
318
319
320 public void setManifestFile( File manifestFile )
321 {
322 this.manifestFile = manifestFile;
323 }
324
325
326
327
328
329
330 public List getClasspathContainers()
331 {
332 return this.classpathContainers;
333 }
334
335
336
337
338
339
340 public void setClasspathContainers( List classpathContainers )
341 {
342 this.classpathContainers = classpathContainers;
343 }
344
345
346
347
348
349
350 public boolean isPde()
351 {
352 return this.pde;
353 }
354
355
356
357
358
359
360 public void setPde( boolean pde )
361 {
362 this.pde = pde;
363 }
364
365
366
367
368
369
370 public List getBuildCommands()
371 {
372 return this.buildCommands;
373 }
374
375
376
377
378
379
380 public void setBuildCommands( List buildCommands )
381 {
382 this.buildCommands = buildCommands;
383 }
384
385
386
387
388
389
390 public List getProjectnatures()
391 {
392 return this.projectnatures;
393 }
394
395
396
397
398
399
400 public void setProjectnatures( List projectnatures )
401 {
402 this.projectnatures = projectnatures;
403 }
404
405
406
407
408
409
410 public Map getProjectFacets()
411 {
412 return projectFacets;
413 }
414
415
416
417
418
419
420 public void setProjectFacets( Map projectFacets )
421 {
422 this.projectFacets = projectFacets;
423 }
424
425
426
427
428
429
430 public File getProjectBaseDir()
431 {
432 return this.projectBaseDir;
433 }
434
435
436
437
438
439
440 public void setProjectBaseDir( File projectBaseDir )
441 {
442 this.projectBaseDir = projectBaseDir;
443 }
444
445
446
447
448
449
450 public boolean isAddVersionToProjectName()
451 {
452 return addVersionToProjectName;
453 }
454
455
456
457
458
459
460 public void setAddVersionToProjectName( boolean addVersionToProjectName )
461 {
462 this.addVersionToProjectName = addVersionToProjectName;
463 }
464
465 public void setProjectNameTemplate( String projectNameTemplate )
466 {
467 this.projectNameTemplate = projectNameTemplate;
468 }
469
470 public String getProjectNameTemplate()
471 {
472 return projectNameTemplate;
473 }
474
475 public String getContextName()
476 {
477 return this.contextName;
478 }
479
480 public void setContextName( String deployName )
481 {
482 this.contextName = deployName;
483 }
484
485
486
487
488 public String getPackaging()
489 {
490 return this.packaging;
491 }
492
493
494
495
496 public void setPackaging( String packaging )
497 {
498 this.packaging = packaging;
499 }
500
501
502
503
504
505
506 public boolean getWtpapplicationxml()
507 {
508 return this.wtpapplicationxml;
509 }
510
511
512
513
514
515
516 public void setWtpapplicationxml( boolean wtpapplicationxml )
517 {
518 this.wtpapplicationxml = wtpapplicationxml;
519 }
520
521
522
523
524
525
526 public float getWtpVersion()
527 {
528 return wtpVersion;
529 }
530
531
532
533
534
535
536 public void setWtpVersion( float wtpVersion )
537 {
538 this.wtpVersion = wtpVersion;
539 }
540
541
542
543
544 public IdeDependency[] getDepsOrdered()
545 {
546 return orderedDeps;
547 }
548
549 }