View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugin.eclipse.writers;
20  
21  import java.io.File;
22  import java.util.List;
23  import java.util.Map;
24  
25  import org.apache.maven.artifact.repository.ArtifactRepository;
26  import org.apache.maven.plugin.eclipse.EclipsePlugin;
27  import org.apache.maven.plugin.eclipse.EclipseSourceDir;
28  import org.apache.maven.plugin.eclipse.WorkspaceConfiguration;
29  import org.apache.maven.plugin.ide.IdeDependency;
30  import org.apache.maven.project.MavenProject;
31  
32  /**
33   * @author Fabrizio Giustina
34   * @version $Id: EclipseWriterConfig.java 1672304 2015-04-09 12:04:28Z khmarbaise $
35   */
36  public class EclipseWriterConfig
37  {
38      /**
39       * The maven project.
40       */
41      private MavenProject project;
42  
43      /**
44       * The maven project packaging.
45       */
46      private String packaging;
47  
48      /**
49       * Eclipse project dir.
50       */
51      private File eclipseProjectDirectory;
52  
53      /**
54       * The name of the project in eclipse.
55       */
56      private String eclipseProjectName;
57  
58      /**
59       * Base project dir.
60       */
61      private File projectBaseDir;
62  
63      /**
64       * List of IDE dependencies.
65       */
66      private IdeDependency[] deps = new IdeDependency[0];
67  
68      /**
69       * Source directories.
70       */
71      private EclipseSourceDir[] sourceDirs;
72  
73      /**
74       * Local maven repo.
75       */
76      private ArtifactRepository localRepository;
77  
78      /**
79       * Build output directory for eclipse.
80       */
81      private File buildOutputDirectory;
82  
83      /**
84       * Manifest file.
85       */
86      private File osgiManifestFile;
87  
88      /**
89       * Project natures.
90       */
91      private List projectnatures;
92  
93      /**
94       * Project facets.
95       */
96      private Map projectFacets;
97  
98      /**
99       * Build commands. List<BuildCommand>
100      */
101     private List buildCommands;
102 
103     /**
104      * Classpath containers.
105      */
106     private List classpathContainers;
107 
108     /**
109      * @see EclipsePlugin#getProjectNameTemplate()
110      */
111     private String projectNameTemplate;
112 
113     /**
114      * @see EclipsePlugin#deployName()
115      */
116 
117     private String contextName;
118 
119     /**
120      * @see EclipsePlugin#wtpapplicationxml()
121      */
122     private boolean wtpapplicationxml;
123 
124     /**
125      * @see EclipsePlugin#getWtpversion()
126      */
127     private float wtpVersion;
128 
129     private float ajdtVersion;
130 
131     private WorkspaceConfiguration workspaceConfiguration;
132 
133     private List linkedResources;
134     
135     /**
136      * @See {@link EclipsePlugin#classpathContainersLast}
137      */
138     private boolean classpathContainersLast;
139     
140     /**
141      * @see {@link EclipsePlugin#jeeversion}
142      */
143     private String jeeVersion;
144 
145     public WorkspaceConfiguration getWorkspaceConfiguration()
146     {
147         return workspaceConfiguration;
148     }
149 
150     public void setWorkspaceConfiguration( WorkspaceConfiguration workspaceConfiguration )
151     {
152         this.workspaceConfiguration = workspaceConfiguration;
153     }
154 
155     /**
156      * Getter for <code>deps</code>.
157      * 
158      * @return Returns the deps.
159      */
160     public IdeDependency[] getDeps()
161     {
162         return deps;
163     }
164 
165     /**
166      * Setter for <code>deps</code>.
167      * 
168      * @param deps The deps to set.
169      */
170     public void setDeps( IdeDependency[] deps )
171     {
172         this.deps = deps;
173     }
174 
175     /**
176      * Getter for <code>eclipseProjectDir</code>.
177      * 
178      * @return Returns the eclipseProjectDir.
179      */
180     public File getEclipseProjectDirectory()
181     {
182         return eclipseProjectDirectory;
183     }
184 
185     /**
186      * Setter for <code>eclipseProjectDir</code>.
187      * 
188      * @param eclipseProjectDir The eclipseProjectDir to set.
189      */
190     public void setEclipseProjectDirectory( File eclipseProjectDir )
191     {
192         eclipseProjectDirectory = eclipseProjectDir;
193     }
194 
195     /**
196      * Getter for <code>eclipseProjectName</code>.
197      * 
198      * @return Returns the project name used in eclipse.
199      */
200     public String getEclipseProjectName()
201     {
202         return eclipseProjectName;
203     }
204 
205     /**
206      * Setter for <code>eclipseProjectName</code>.
207      * 
208      * @param eclipseProjectName the project name used in eclipse.
209      */
210     public void setEclipseProjectName( String eclipseProjectName )
211     {
212         this.eclipseProjectName = eclipseProjectName;
213     }
214 
215     /**
216      * Getter for <code>project</code>.
217      * 
218      * @return Returns the project.
219      */
220     public MavenProject getProject()
221     {
222         return project;
223     }
224 
225     /**
226      * Setter for <code>project</code>.
227      * 
228      * @param project The project to set.
229      */
230     public void setProject( MavenProject project )
231     {
232         this.project = project;
233     }
234 
235     /**
236      * Getter for <code>sourceDirs</code>.
237      * 
238      * @return Returns the sourceDirs.
239      */
240     public EclipseSourceDir[] getSourceDirs()
241     {
242         return sourceDirs;
243     }
244 
245     /**
246      * Setter for <code>sourceDirs</code>.
247      * 
248      * @param sourceDirs The sourceDirs to set.
249      */
250     public void setSourceDirs( EclipseSourceDir[] sourceDirs )
251     {
252         this.sourceDirs = sourceDirs;
253     }
254 
255     /**
256      * Getter for <code>buildOutputDirectory</code>.
257      * 
258      * @return Returns the buildOutputDirectory.
259      */
260     public File getBuildOutputDirectory()
261     {
262         return buildOutputDirectory;
263     }
264 
265     /**
266      * Setter for <code>buildOutputDirectory</code>.
267      * 
268      * @param buildOutputDirectory The buildOutputDirectory to set.
269      */
270     public void setBuildOutputDirectory( File buildOutputDirectory )
271     {
272         this.buildOutputDirectory = buildOutputDirectory;
273     }
274 
275     /**
276      * Getter for <code>localRepository</code>.
277      * 
278      * @return Returns the localRepository.
279      */
280     public ArtifactRepository getLocalRepository()
281     {
282         return localRepository;
283     }
284 
285     /**
286      * Setter for <code>localRepository</code>.
287      * 
288      * @param localRepository The localRepository to set.
289      */
290     public void setLocalRepository( ArtifactRepository localRepository )
291     {
292         this.localRepository = localRepository;
293     }
294 
295     /**
296      * Getter for <code>manifestFile</code>.
297      * 
298      * @return Returns the manifestFile.
299      */
300     public File getOSGIManifestFile()
301     {
302         return osgiManifestFile;
303     }
304 
305     /**
306      * Setter for <code>manifestFile</code>.
307      * 
308      * @param manifestFile The manifestFile to set.
309      */
310     public void setOSGIManifestFile( File manifestFile )
311     {
312         this.osgiManifestFile = manifestFile;
313     }
314 
315     /**
316      * Getter for <code>classpathContainers</code>.
317      * 
318      * @return Returns the classpathContainers.
319      */
320     public List getClasspathContainers()
321     {
322         return classpathContainers;
323     }
324 
325     /**
326      * Setter for <code>classpathContainers</code>.
327      * 
328      * @param classpathContainers The classpathContainers to set.
329      */
330     public void setClasspathContainers( List classpathContainers )
331     {
332         this.classpathContainers = classpathContainers;
333     }
334 
335     /**
336      * Getter for <code>buildCommands</code>.
337      *
338      * @return Returns the buildCommands.
339      */
340     public List getBuildCommands()
341     {
342         return buildCommands;
343     }
344 
345     /**
346      * Setter for <code>buildCommands</code>.
347      * 
348      * @param buildCommands The buildCommands to set.
349      */
350     public void setBuildCommands( List buildCommands )
351     {
352         this.buildCommands = buildCommands;
353     }
354 
355     /**
356      * Getter for <code>projectnatures</code>.
357      * 
358      * @return Returns the projectnatures.
359      */
360     public List getProjectnatures()
361     {
362         return projectnatures;
363     }
364 
365     /**
366      * Setter for <code>projectnatures</code>.
367      * 
368      * @param projectnatures The projectnatures to set.
369      */
370     public void setProjectnatures( List projectnatures )
371     {
372         this.projectnatures = projectnatures;
373     }
374 
375     /**
376      * Getter for <code>projectFacets</code>.
377      * 
378      * @return Returns the projectFacets
379      */
380     public Map getProjectFacets()
381     {
382         return projectFacets;
383     }
384 
385     /**
386      * Setter for <code>projectFacets</code>
387      * 
388      * @param projectFacets The projectFacets to set.
389      */
390     public void setProjectFacets( Map projectFacets )
391     {
392         this.projectFacets = projectFacets;
393     }
394 
395     /**
396      * Getter for <code>projectBaseDir</code>.
397      * 
398      * @return Returns the projectBaseDir.
399      */
400     public File getProjectBaseDir()
401     {
402         return projectBaseDir;
403     }
404 
405     /**
406      * Setter for <code>projectBaseDir</code>.
407      * 
408      * @param projectBaseDir The projectBaseDir to set.
409      */
410     public void setProjectBaseDir( File projectBaseDir )
411     {
412         this.projectBaseDir = projectBaseDir;
413     }
414 
415     public void setProjectNameTemplate( String projectNameTemplate )
416     {
417         this.projectNameTemplate = projectNameTemplate;
418     }
419 
420     public String getProjectNameTemplate()
421     {
422         return projectNameTemplate;
423     }
424 
425     public String getContextName()
426     {
427         return contextName;
428     }
429 
430     public void setContextName( String deployName )
431     {
432         contextName = deployName;
433     }
434 
435     /**
436      * @return the packaging
437      */
438     public String getPackaging()
439     {
440         return packaging;
441     }
442 
443     /**
444      * @param packaging the packaging to set
445      */
446     public void setPackaging( String packaging )
447     {
448         this.packaging = packaging;
449     }
450 
451     /**
452      * Getter for <code>wtpapplicationxml</code>.
453      * 
454      * @return Returns the wtpapplicationxml.
455      */
456     public boolean getWtpapplicationxml()
457     {
458         return wtpapplicationxml;
459     }
460 
461     /**
462      * Setter for <code>buildCommands</code>.
463      * 
464      * @param buildCommands The buildCommands to set.
465      */
466     public void setWtpapplicationxml( boolean wtpapplicationxml )
467     {
468         this.wtpapplicationxml = wtpapplicationxml;
469     }
470 
471     /**
472      * Getter for <code>wtpVersion</code>.
473      * 
474      * @return Returns the wtpVersion.
475      */
476     public float getWtpVersion()
477     {
478         return wtpVersion;
479     }
480 
481     /**
482      * Setter for <code>wtpVersion</code>.
483      * 
484      * @param wtpVersion The wtpVersion to set.
485      */
486     public void setWtpVersion( float wtpVersion )
487     {
488         this.wtpVersion = wtpVersion;
489     }
490 
491     /**
492      * Returns the ajdtVersion.
493      * 
494      * @return the ajdtVersion.
495      */
496     public float getAjdtVersion()
497     {
498         return ajdtVersion;
499     }
500 
501     /**
502      * Sets the ajdtVersion.
503      * 
504      * @param ajdtVersion the ajdtVersion.
505      */
506     public void setAjdtVersion( float ajdtVersion )
507     {
508         this.ajdtVersion = ajdtVersion;
509     }
510 
511     /**
512      * @return the linkedResources
513      */
514     public List getLinkedResources()
515     {
516         return linkedResources;
517     }
518 
519     /**
520      * @param linkedResources the linkedResources to set
521      */
522     public void setLinkedResources( List linkedResources )
523     {
524         this.linkedResources = linkedResources;
525     }
526 
527     
528     /**
529      * Returns the classpathContainersLast.
530      * @return the classpathContainersLast
531      */
532     public boolean isClasspathContainersLast()
533     {
534         return classpathContainersLast;
535     }
536 
537     
538     /**
539      * Sets the classpathContainersLast.
540      * @param classpathContainersLast the classpathContainersLast to set
541      */
542     public void setClasspathContainersLast(boolean classpathContainersLast)
543     {
544         this.classpathContainersLast = classpathContainersLast;
545     }
546 
547     /**
548      * Sets the jeeversion.
549      * @return the jeeversion
550      */
551     public String getJeeVersion()
552     {
553         return jeeVersion;
554     }
555 
556     /**
557      * Returns the jeeversion
558      * @param jeeversion the jeeversion
559      */
560     public void setJeeVersion( String jeeVersion )
561     {
562         this.jeeVersion = jeeVersion;
563     }
564 
565 }