View Javadoc

1   package org.apache.maven.plugins.enforcer;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  import java.io.IOException;
24  import java.io.Writer;
25  import java.util.Collections;
26  import java.util.List;
27  import java.util.Map;
28  import java.util.Properties;
29  import java.util.Set;
30  
31  import org.apache.maven.artifact.Artifact;
32  import org.apache.maven.artifact.DependencyResolutionRequiredException;
33  import org.apache.maven.artifact.factory.ArtifactFactory;
34  import org.apache.maven.artifact.repository.ArtifactRepository;
35  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
36  import org.apache.maven.model.Build;
37  import org.apache.maven.model.CiManagement;
38  import org.apache.maven.model.Contributor;
39  import org.apache.maven.model.DependencyManagement;
40  import org.apache.maven.model.Developer;
41  import org.apache.maven.model.DistributionManagement;
42  import org.apache.maven.model.IssueManagement;
43  import org.apache.maven.model.License;
44  import org.apache.maven.model.MailingList;
45  import org.apache.maven.model.Model;
46  import org.apache.maven.model.Organization;
47  import org.apache.maven.model.Plugin;
48  import org.apache.maven.model.PluginManagement;
49  import org.apache.maven.model.Prerequisites;
50  import org.apache.maven.model.Reporting;
51  import org.apache.maven.model.Resource;
52  import org.apache.maven.model.Scm;
53  import org.apache.maven.project.MavenProject;
54  import org.apache.maven.project.artifact.InvalidDependencyVersionException;
55  import org.codehaus.plexus.PlexusTestCase;
56  import org.codehaus.plexus.util.xml.Xpp3Dom;
57  
58  /**
59   * very simple stub of maven project, going to take a lot of work to make it useful as a stub though.
60   */
61  public class MockProject
62      extends MavenProject
63  {
64  
65      /** The group id. */
66      private String groupId;
67  
68      /** The artifact id. */
69      private String artifactId;
70  
71      /** The name. */
72      private String name;
73  
74      /** The model. */
75      private Model model;
76  
77      /** The parent. */
78      private MavenProject parent;
79  
80      /** The dependencies. */
81      private List dependencies;
82  
83      /** The file. */
84      private File file;
85  
86      /** The collected projects. */
87      private List collectedProjects;
88  
89      /** The attached artifacts. */
90      private List attachedArtifacts;
91  
92      /** The compile source roots. */
93      private List compileSourceRoots;
94  
95      /** The test compile source roots. */
96      private List testCompileSourceRoots;
97  
98      /** The script source roots. */
99      private List scriptSourceRoots;
100 
101     /** The plugin artifact repositories. */
102     private List pluginArtifactRepositories;
103 
104     // private ArtifactRepository releaseArtifactRepository;
105 
106     // private ArtifactRepository snapshotArtifactRepository;
107 
108     /** The active profiles. */
109     private List activeProfiles;
110 
111     /** The dependency artifacts. */
112     private Set dependencyArtifacts;
113 
114     /** The dependency management. */
115     private DependencyManagement dependencyManagement;
116 
117     /** The artifact. */
118     private Artifact artifact;
119 
120     // private Map artifactMap;
121 
122     /** The original model. */
123     private Model originalModel;
124 
125     // private Map pluginArtifactMap;
126 
127     // private Map reportArtifactMap;
128 
129     // private Map extensionArtifactMap;
130 
131     // private Map projectReferences;
132 
133     // private Build buildOverlay;
134 
135     /** The execution root. */
136     private boolean executionRoot;
137 
138     /** The compile artifacts. */
139     private List compileArtifacts;
140 
141     /** The compile dependencies. */
142     private List compileDependencies;
143 
144     /** The system dependencies. */
145     private List systemDependencies;
146 
147     /** The test classpath elements. */
148     private List testClasspathElements;
149 
150     /** The test dependencies. */
151     private List testDependencies;
152 
153     /** The system classpath elements. */
154     private List systemClasspathElements;
155 
156     /** The system artifacts. */
157     private List systemArtifacts;
158 
159     /** The test artifacts. */
160     private List testArtifacts;
161 
162     /** The runtime artifacts. */
163     private List runtimeArtifacts;
164 
165     /** The runtime dependencies. */
166     private List runtimeDependencies;
167 
168     /** The runtime classpath elements. */
169     private List runtimeClasspathElements;
170 
171     /** The model version. */
172     private String modelVersion;
173 
174     /** The packaging. */
175     private String packaging;
176 
177     /** The inception year. */
178     private String inceptionYear;
179 
180     /** The url. */
181     private String url;
182 
183     /** The description. */
184     private String description;
185 
186     /** The version. */
187     private String version;
188 
189     /** The default goal. */
190     private String defaultGoal;
191 
192     /** The artifacts. */
193     private Set artifacts;
194 
195     /** The properties. */
196     private Properties properties = new Properties();
197 
198     /** The base dir. */
199     private File baseDir = null;
200 
201     /**
202      * Instantiates a new mock project.
203      */
204     public MockProject()
205     {
206         super( (Model) null );
207     }
208 
209     // kinda dangerous...
210     /**
211      * Instantiates a new mock project.
212      *
213      * @param model the model
214      */
215     public MockProject( Model model )
216     {
217         // super(model);
218         super( (Model) null );
219     }
220 
221     // kinda dangerous...
222     /**
223      * Instantiates a new mock project.
224      *
225      * @param project the project
226      */
227     public MockProject( MavenProject project )
228     {
229         // super(project);
230         super( (Model) null );
231     }
232 
233     /*
234      * (non-Javadoc)
235      *
236      * @see org.apache.maven.project.MavenProject#getModulePathAdjustment(org.apache.maven.project.MavenProject)
237      */
238     public String getModulePathAdjustment( MavenProject mavenProject )
239         throws IOException
240     {
241         return "";
242     }
243 
244     /*
245      * (non-Javadoc)
246      *
247      * @see org.apache.maven.project.MavenProject#getArtifact()
248      */
249     public Artifact getArtifact()
250     {
251         return artifact;
252     }
253 
254     /*
255      * (non-Javadoc)
256      *
257      * @see org.apache.maven.project.MavenProject#setArtifact(org.apache.maven.artifact.Artifact)
258      */
259     public void setArtifact( Artifact artifact )
260     {
261         this.artifact = artifact;
262     }
263 
264     /*
265      * (non-Javadoc)
266      *
267      * @see org.apache.maven.project.MavenProject#getModel()
268      */
269     public Model getModel()
270     {
271         return model;
272     }
273 
274     /*
275      * (non-Javadoc)
276      *
277      * @see org.apache.maven.project.MavenProject#getParent()
278      */
279     public MavenProject getParent()
280     {
281         return parent;
282     }
283 
284     /*
285      * (non-Javadoc)
286      *
287      * @see org.apache.maven.project.MavenProject#setParent(org.apache.maven.project.MavenProject)
288      */
289     public void setParent( MavenProject mavenProject )
290     {
291         this.parent = mavenProject;
292     }
293 
294     /*
295      * (non-Javadoc)
296      *
297      * @see org.apache.maven.project.MavenProject#setRemoteArtifactRepositories(java.util.List)
298      */
299     public void setRemoteArtifactRepositories( List list )
300     {
301 
302     }
303 
304     /*
305      * (non-Javadoc)
306      *
307      * @see org.apache.maven.project.MavenProject#getRemoteArtifactRepositories()
308      */
309     public List getRemoteArtifactRepositories()
310     {
311         return Collections.singletonList( "" );
312     }
313 
314     /*
315      * (non-Javadoc)
316      *
317      * @see org.apache.maven.project.MavenProject#hasParent()
318      */
319     public boolean hasParent()
320     {
321         if ( parent != null )
322         {
323             return true;
324         }
325         else
326         {
327             return false;
328         }
329     }
330 
331     /*
332      * (non-Javadoc)
333      *
334      * @see org.apache.maven.project.MavenProject#getFile()
335      */
336     public File getFile()
337     {
338         return file;
339     }
340 
341     /*
342      * (non-Javadoc)
343      *
344      * @see org.apache.maven.project.MavenProject#setFile(java.io.File)
345      */
346     public void setFile( File file )
347     {
348         this.file = file;
349     }
350 
351     /*
352      * (non-Javadoc)
353      *
354      * @see org.apache.maven.project.MavenProject#getBasedir()
355      */
356     public File getBasedir()
357     {
358         if ( baseDir == null )
359         {
360             baseDir = new File( PlexusTestCase.getBasedir() );
361         }
362         return baseDir;
363     }
364 
365     /**
366      * Sets the base dir.
367      *
368      * @param base the new base dir
369      */
370     public void setBaseDir( File base )
371     {
372         baseDir = base;
373     }
374 
375     /*
376      * (non-Javadoc)
377      *
378      * @see org.apache.maven.project.MavenProject#setDependencies(java.util.List)
379      */
380     public void setDependencies( List list )
381     {
382         dependencies = list;
383     }
384 
385     /*
386      * (non-Javadoc)
387      *
388      * @see org.apache.maven.project.MavenProject#getDependencies()
389      */
390     public List getDependencies()
391     {
392         if ( dependencies == null )
393         {
394             dependencies = Collections.EMPTY_LIST;
395         }
396         return dependencies;
397     }
398 
399     /**
400      * Sets the dependency management.
401      *
402      * @param depMgt the new dependency management
403      */
404     public void setDependencyManagement( DependencyManagement depMgt )
405     {
406         this.dependencyManagement = depMgt;
407     }
408 
409     /*
410      * (non-Javadoc)
411      *
412      * @see org.apache.maven.project.MavenProject#getDependencyManagement()
413      */
414     public DependencyManagement getDependencyManagement()
415     {
416         if ( dependencyManagement == null )
417         {
418             dependencyManagement = new DependencyManagement();
419         }
420 
421         return dependencyManagement;
422     }
423 
424     /*
425      * (non-Javadoc)
426      *
427      * @see org.apache.maven.project.MavenProject#addCompileSourceRoot(java.lang.String)
428      */
429     public void addCompileSourceRoot( String string )
430     {
431         if ( compileSourceRoots == null )
432         {
433             compileSourceRoots = Collections.singletonList( string );
434         }
435         else
436         {
437             compileSourceRoots.add( string );
438         }
439     }
440 
441     /*
442      * (non-Javadoc)
443      *
444      * @see org.apache.maven.project.MavenProject#addScriptSourceRoot(java.lang.String)
445      */
446     public void addScriptSourceRoot( String string )
447     {
448         if ( scriptSourceRoots == null )
449         {
450             scriptSourceRoots = Collections.singletonList( string );
451         }
452         else
453         {
454             scriptSourceRoots.add( string );
455         }
456     }
457 
458     /*
459      * (non-Javadoc)
460      *
461      * @see org.apache.maven.project.MavenProject#addTestCompileSourceRoot(java.lang.String)
462      */
463     public void addTestCompileSourceRoot( String string )
464     {
465         if ( testCompileSourceRoots == null )
466         {
467             testCompileSourceRoots = Collections.singletonList( string );
468         }
469         else
470         {
471             testCompileSourceRoots.add( string );
472         }
473     }
474 
475     /*
476      * (non-Javadoc)
477      *
478      * @see org.apache.maven.project.MavenProject#getCompileSourceRoots()
479      */
480     public List getCompileSourceRoots()
481     {
482         return compileSourceRoots;
483     }
484 
485     /*
486      * (non-Javadoc)
487      *
488      * @see org.apache.maven.project.MavenProject#getScriptSourceRoots()
489      */
490     public List getScriptSourceRoots()
491     {
492         return scriptSourceRoots;
493     }
494 
495     /*
496      * (non-Javadoc)
497      *
498      * @see org.apache.maven.project.MavenProject#getTestCompileSourceRoots()
499      */
500     public List getTestCompileSourceRoots()
501     {
502         return testCompileSourceRoots;
503     }
504 
505     /*
506      * (non-Javadoc)
507      *
508      * @see org.apache.maven.project.MavenProject#getCompileClasspathElements()
509      */
510     public List getCompileClasspathElements()
511         throws DependencyResolutionRequiredException
512     {
513         return compileSourceRoots;
514     }
515 
516     /**
517      * Sets the compile artifacts.
518      *
519      * @param compileArtifacts the new compile artifacts
520      */
521     public void setCompileArtifacts( List compileArtifacts )
522     {
523         this.compileArtifacts = compileArtifacts;
524     }
525 
526     /*
527      * (non-Javadoc)
528      *
529      * @see org.apache.maven.project.MavenProject#getCompileArtifacts()
530      */
531     public List getCompileArtifacts()
532     {
533         return compileArtifacts;
534     }
535 
536     /*
537      * (non-Javadoc)
538      *
539      * @see org.apache.maven.project.MavenProject#getCompileDependencies()
540      */
541     public List getCompileDependencies()
542     {
543         return compileDependencies;
544     }
545 
546     /*
547      * (non-Javadoc)
548      *
549      * @see org.apache.maven.project.MavenProject#getTestClasspathElements()
550      */
551     public List getTestClasspathElements()
552         throws DependencyResolutionRequiredException
553     {
554         return testClasspathElements;
555     }
556 
557     /*
558      * (non-Javadoc)
559      *
560      * @see org.apache.maven.project.MavenProject#getTestArtifacts()
561      */
562     public List getTestArtifacts()
563     {
564         return testArtifacts;
565     }
566 
567     /*
568      * (non-Javadoc)
569      *
570      * @see org.apache.maven.project.MavenProject#getTestDependencies()
571      */
572     public List getTestDependencies()
573     {
574         return testDependencies;
575     }
576 
577     /*
578      * (non-Javadoc)
579      *
580      * @see org.apache.maven.project.MavenProject#getRuntimeClasspathElements()
581      */
582     public List getRuntimeClasspathElements()
583         throws DependencyResolutionRequiredException
584     {
585         return runtimeClasspathElements;
586     }
587 
588     /*
589      * (non-Javadoc)
590      *
591      * @see org.apache.maven.project.MavenProject#getRuntimeArtifacts()
592      */
593     public List getRuntimeArtifacts()
594     {
595         return runtimeArtifacts;
596     }
597 
598     /*
599      * (non-Javadoc)
600      *
601      * @see org.apache.maven.project.MavenProject#getRuntimeDependencies()
602      */
603     public List getRuntimeDependencies()
604     {
605         return runtimeDependencies;
606     }
607 
608     /*
609      * (non-Javadoc)
610      *
611      * @see org.apache.maven.project.MavenProject#getSystemClasspathElements()
612      */
613     public List getSystemClasspathElements()
614         throws DependencyResolutionRequiredException
615     {
616         return systemClasspathElements;
617     }
618 
619     /*
620      * (non-Javadoc)
621      *
622      * @see org.apache.maven.project.MavenProject#getSystemArtifacts()
623      */
624     public List getSystemArtifacts()
625     {
626         return systemArtifacts;
627     }
628 
629     /**
630      * Sets the runtime classpath elements.
631      *
632      * @param runtimeClasspathElements the new runtime classpath elements
633      */
634     public void setRuntimeClasspathElements( List runtimeClasspathElements )
635     {
636         this.runtimeClasspathElements = runtimeClasspathElements;
637     }
638 
639     /**
640      * Sets the attached artifacts.
641      *
642      * @param attachedArtifacts the new attached artifacts
643      */
644     public void setAttachedArtifacts( List attachedArtifacts )
645     {
646         this.attachedArtifacts = attachedArtifacts;
647     }
648 
649     /**
650      * Sets the compile source roots.
651      *
652      * @param compileSourceRoots the new compile source roots
653      */
654     public void setCompileSourceRoots( List compileSourceRoots )
655     {
656         this.compileSourceRoots = compileSourceRoots;
657     }
658 
659     /**
660      * Sets the test compile source roots.
661      *
662      * @param testCompileSourceRoots the new test compile source roots
663      */
664     public void setTestCompileSourceRoots( List testCompileSourceRoots )
665     {
666         this.testCompileSourceRoots = testCompileSourceRoots;
667     }
668 
669     /**
670      * Sets the script source roots.
671      *
672      * @param scriptSourceRoots the new script source roots
673      */
674     public void setScriptSourceRoots( List scriptSourceRoots )
675     {
676         this.scriptSourceRoots = scriptSourceRoots;
677     }
678 
679     /**
680      * Sets the artifact map.
681      *
682      * @param artifactMap the new artifact map
683      */
684     public void setArtifactMap( Map artifactMap )
685     {
686         // this.artifactMap = artifactMap;
687     }
688 
689     /**
690      * Sets the plugin artifact map.
691      *
692      * @param pluginArtifactMap the new plugin artifact map
693      */
694     public void setPluginArtifactMap( Map pluginArtifactMap )
695     {
696         // this.pluginArtifactMap = pluginArtifactMap;
697     }
698 
699     /**
700      * Sets the report artifact map.
701      *
702      * @param reportArtifactMap the new report artifact map
703      */
704     public void setReportArtifactMap( Map reportArtifactMap )
705     {
706         // this.reportArtifactMap = reportArtifactMap;
707     }
708 
709     /**
710      * Sets the extension artifact map.
711      *
712      * @param extensionArtifactMap the new extension artifact map
713      */
714     public void setExtensionArtifactMap( Map extensionArtifactMap )
715     {
716         // this.extensionArtifactMap = extensionArtifactMap;
717     }
718 
719     /**
720      * Sets the project references.
721      *
722      * @param projectReferences the new project references
723      */
724     public void setProjectReferences( Map projectReferences )
725     {
726         // this.projectReferences = projectReferences;
727     }
728 
729     /**
730      * Sets the builds the overlay.
731      *
732      * @param buildOverlay the new builds the overlay
733      */
734     public void setBuildOverlay( Build buildOverlay )
735     {
736         // this.buildOverlay = buildOverlay;
737     }
738 
739     /**
740      * Sets the compile dependencies.
741      *
742      * @param compileDependencies the new compile dependencies
743      */
744     public void setCompileDependencies( List compileDependencies )
745     {
746         this.compileDependencies = compileDependencies;
747     }
748 
749     /**
750      * Sets the system dependencies.
751      *
752      * @param systemDependencies the new system dependencies
753      */
754     public void setSystemDependencies( List systemDependencies )
755     {
756         this.systemDependencies = systemDependencies;
757     }
758 
759     /**
760      * Sets the test classpath elements.
761      *
762      * @param testClasspathElements the new test classpath elements
763      */
764     public void setTestClasspathElements( List testClasspathElements )
765     {
766         this.testClasspathElements = testClasspathElements;
767     }
768 
769     /**
770      * Sets the test dependencies.
771      *
772      * @param testDependencies the new test dependencies
773      */
774     public void setTestDependencies( List testDependencies )
775     {
776         this.testDependencies = testDependencies;
777     }
778 
779     /**
780      * Sets the system classpath elements.
781      *
782      * @param systemClasspathElements the new system classpath elements
783      */
784     public void setSystemClasspathElements( List systemClasspathElements )
785     {
786         this.systemClasspathElements = systemClasspathElements;
787     }
788 
789     /**
790      * Sets the system artifacts.
791      *
792      * @param systemArtifacts the new system artifacts
793      */
794     public void setSystemArtifacts( List systemArtifacts )
795     {
796         this.systemArtifacts = systemArtifacts;
797     }
798 
799     /**
800      * Sets the test artifacts.
801      *
802      * @param testArtifacts the new test artifacts
803      */
804     public void setTestArtifacts( List testArtifacts )
805     {
806         this.testArtifacts = testArtifacts;
807     }
808 
809     /**
810      * Sets the runtime artifacts.
811      *
812      * @param runtimeArtifacts the new runtime artifacts
813      */
814     public void setRuntimeArtifacts( List runtimeArtifacts )
815     {
816         this.runtimeArtifacts = runtimeArtifacts;
817     }
818 
819     /**
820      * Sets the runtime dependencies.
821      *
822      * @param runtimeDependencies the new runtime dependencies
823      */
824     public void setRuntimeDependencies( List runtimeDependencies )
825     {
826         this.runtimeDependencies = runtimeDependencies;
827     }
828 
829     /**
830      * Sets the model.
831      *
832      * @param model the new model
833      */
834     public void setModel( Model model )
835     {
836         this.model = model;
837     }
838 
839     /*
840      * (non-Javadoc)
841      *
842      * @see org.apache.maven.project.MavenProject#getSystemDependencies()
843      */
844     public List getSystemDependencies()
845     {
846         return systemDependencies;
847     }
848 
849     /*
850      * (non-Javadoc)
851      *
852      * @see org.apache.maven.project.MavenProject#setModelVersion(java.lang.String)
853      */
854     public void setModelVersion( String string )
855     {
856         this.modelVersion = string;
857     }
858 
859     /*
860      * (non-Javadoc)
861      *
862      * @see org.apache.maven.project.MavenProject#getModelVersion()
863      */
864     public String getModelVersion()
865     {
866         return modelVersion;
867     }
868 
869     /*
870      * (non-Javadoc)
871      *
872      * @see org.apache.maven.project.MavenProject#getId()
873      */
874     public String getId()
875     {
876         return "";
877     }
878 
879     /*
880      * (non-Javadoc)
881      *
882      * @see org.apache.maven.project.MavenProject#setGroupId(java.lang.String)
883      */
884     public void setGroupId( String string )
885     {
886         this.groupId = string;
887     }
888 
889     /*
890      * (non-Javadoc)
891      *
892      * @see org.apache.maven.project.MavenProject#getGroupId()
893      */
894     public String getGroupId()
895     {
896         return groupId;
897     }
898 
899     /*
900      * (non-Javadoc)
901      *
902      * @see org.apache.maven.project.MavenProject#setArtifactId(java.lang.String)
903      */
904     public void setArtifactId( String string )
905     {
906         this.artifactId = string;
907     }
908 
909     /*
910      * (non-Javadoc)
911      *
912      * @see org.apache.maven.project.MavenProject#getArtifactId()
913      */
914     public String getArtifactId()
915     {
916         return artifactId;
917     }
918 
919     /*
920      * (non-Javadoc)
921      *
922      * @see org.apache.maven.project.MavenProject#setName(java.lang.String)
923      */
924     public void setName( String string )
925     {
926         this.name = string;
927     }
928 
929     /*
930      * (non-Javadoc)
931      *
932      * @see org.apache.maven.project.MavenProject#getName()
933      */
934     public String getName()
935     {
936         return name;
937     }
938 
939     /*
940      * (non-Javadoc)
941      *
942      * @see org.apache.maven.project.MavenProject#setVersion(java.lang.String)
943      */
944     public void setVersion( String string )
945     {
946         this.version = string;
947     }
948 
949     /*
950      * (non-Javadoc)
951      *
952      * @see org.apache.maven.project.MavenProject#getVersion()
953      */
954     public String getVersion()
955     {
956         return version;
957     }
958 
959     /*
960      * (non-Javadoc)
961      *
962      * @see org.apache.maven.project.MavenProject#getPackaging()
963      */
964     public String getPackaging()
965     {
966         return packaging;
967     }
968 
969     /*
970      * (non-Javadoc)
971      *
972      * @see org.apache.maven.project.MavenProject#setPackaging(java.lang.String)
973      */
974     public void setPackaging( String string )
975     {
976         this.packaging = string;
977     }
978 
979     /*
980      * (non-Javadoc)
981      *
982      * @see org.apache.maven.project.MavenProject#setInceptionYear(java.lang.String)
983      */
984     public void setInceptionYear( String string )
985     {
986         this.inceptionYear = string;
987     }
988 
989     /*
990      * (non-Javadoc)
991      *
992      * @see org.apache.maven.project.MavenProject#getInceptionYear()
993      */
994     public String getInceptionYear()
995     {
996         return inceptionYear;
997     }
998 
999     /*
1000      * (non-Javadoc)
1001      *
1002      * @see org.apache.maven.project.MavenProject#setUrl(java.lang.String)
1003      */
1004     public void setUrl( String string )
1005     {
1006         this.url = string;
1007     }
1008 
1009     /*
1010      * (non-Javadoc)
1011      *
1012      * @see org.apache.maven.project.MavenProject#getUrl()
1013      */
1014     public String getUrl()
1015     {
1016         return url;
1017     }
1018 
1019     /*
1020      * (non-Javadoc)
1021      *
1022      * @see org.apache.maven.project.MavenProject#getPrerequisites()
1023      */
1024     public Prerequisites getPrerequisites()
1025     {
1026         return null;
1027     }
1028 
1029     /*
1030      * (non-Javadoc)
1031      *
1032      * @see org.apache.maven.project.MavenProject#setIssueManagement(org.apache.maven.model.IssueManagement)
1033      */
1034     public void setIssueManagement( IssueManagement issueManagement )
1035     {
1036 
1037     }
1038 
1039     /*
1040      * (non-Javadoc)
1041      *
1042      * @see org.apache.maven.project.MavenProject#getCiManagement()
1043      */
1044     public CiManagement getCiManagement()
1045     {
1046         return null;
1047     }
1048 
1049     /*
1050      * (non-Javadoc)
1051      *
1052      * @see org.apache.maven.project.MavenProject#setCiManagement(org.apache.maven.model.CiManagement)
1053      */
1054     public void setCiManagement( CiManagement ciManagement )
1055     {
1056 
1057     }
1058 
1059     /*
1060      * (non-Javadoc)
1061      *
1062      * @see org.apache.maven.project.MavenProject#getIssueManagement()
1063      */
1064     public IssueManagement getIssueManagement()
1065     {
1066         return null;
1067     }
1068 
1069     /*
1070      * (non-Javadoc)
1071      *
1072      * @see org.apache.maven.project.MavenProject#setDistributionManagement(org.apache.maven.model.DistributionManagement)
1073      */
1074     public void setDistributionManagement( DistributionManagement distributionManagement )
1075     {
1076 
1077     }
1078 
1079     /*
1080      * (non-Javadoc)
1081      *
1082      * @see org.apache.maven.project.MavenProject#getDistributionManagement()
1083      */
1084     public DistributionManagement getDistributionManagement()
1085     {
1086         return null;
1087     }
1088 
1089     /*
1090      * (non-Javadoc)
1091      *
1092      * @see org.apache.maven.project.MavenProject#setDescription(java.lang.String)
1093      */
1094     public void setDescription( String string )
1095     {
1096         this.description = string;
1097     }
1098 
1099     /*
1100      * (non-Javadoc)
1101      *
1102      * @see org.apache.maven.project.MavenProject#getDescription()
1103      */
1104     public String getDescription()
1105     {
1106         return description;
1107     }
1108 
1109     /*
1110      * (non-Javadoc)
1111      *
1112      * @see org.apache.maven.project.MavenProject#setOrganization(org.apache.maven.model.Organization)
1113      */
1114     public void setOrganization( Organization organization )
1115     {
1116 
1117     }
1118 
1119     /*
1120      * (non-Javadoc)
1121      *
1122      * @see org.apache.maven.project.MavenProject#getOrganization()
1123      */
1124     public Organization getOrganization()
1125     {
1126         return null;
1127     }
1128 
1129     /*
1130      * (non-Javadoc)
1131      *
1132      * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
1133      */
1134     public void setScm( Scm scm )
1135     {
1136 
1137     }
1138 
1139     /*
1140      * (non-Javadoc)
1141      *
1142      * @see org.apache.maven.project.MavenProject#getScm()
1143      */
1144     public Scm getScm()
1145     {
1146         return null;
1147     }
1148 
1149     /*
1150      * (non-Javadoc)
1151      *
1152      * @see org.apache.maven.project.MavenProject#setMailingLists(java.util.List)
1153      */
1154     public void setMailingLists( List list )
1155     {
1156 
1157     }
1158 
1159     /*
1160      * (non-Javadoc)
1161      *
1162      * @see org.apache.maven.project.MavenProject#getMailingLists()
1163      */
1164     public List getMailingLists()
1165     {
1166         return Collections.singletonList( "" );
1167     }
1168 
1169     /*
1170      * (non-Javadoc)
1171      *
1172      * @see org.apache.maven.project.MavenProject#addMailingList(org.apache.maven.model.MailingList)
1173      */
1174     public void addMailingList( MailingList mailingList )
1175     {
1176 
1177     }
1178 
1179     /*
1180      * (non-Javadoc)
1181      *
1182      * @see org.apache.maven.project.MavenProject#setDevelopers(java.util.List)
1183      */
1184     public void setDevelopers( List list )
1185     {
1186 
1187     }
1188 
1189     /*
1190      * (non-Javadoc)
1191      *
1192      * @see org.apache.maven.project.MavenProject#getDevelopers()
1193      */
1194     public List getDevelopers()
1195     {
1196         return Collections.singletonList( "" );
1197     }
1198 
1199     /*
1200      * (non-Javadoc)
1201      *
1202      * @see org.apache.maven.project.MavenProject#addDeveloper(org.apache.maven.model.Developer)
1203      */
1204     public void addDeveloper( Developer developer )
1205     {
1206 
1207     }
1208 
1209     /*
1210      * (non-Javadoc)
1211      *
1212      * @see org.apache.maven.project.MavenProject#setContributors(java.util.List)
1213      */
1214     public void setContributors( List list )
1215     {
1216 
1217     }
1218 
1219     /*
1220      * (non-Javadoc)
1221      *
1222      * @see org.apache.maven.project.MavenProject#getContributors()
1223      */
1224     public List getContributors()
1225     {
1226         return Collections.singletonList( "" );
1227     }
1228 
1229     /*
1230      * (non-Javadoc)
1231      *
1232      * @see org.apache.maven.project.MavenProject#addContributor(org.apache.maven.model.Contributor)
1233      */
1234     public void addContributor( Contributor contributor )
1235     {
1236 
1237     }
1238 
1239     /*
1240      * (non-Javadoc)
1241      *
1242      * @see org.apache.maven.project.MavenProject#setBuild(org.apache.maven.model.Build)
1243      */
1244     public void setBuild( Build build )
1245     {
1246 
1247     }
1248 
1249     /*
1250      * (non-Javadoc)
1251      *
1252      * @see org.apache.maven.project.MavenProject#getBuild()
1253      */
1254     public Build getBuild()
1255     {
1256         return null;
1257     }
1258 
1259     /*
1260      * (non-Javadoc)
1261      *
1262      * @see org.apache.maven.project.MavenProject#getResources()
1263      */
1264     public List getResources()
1265     {
1266         return Collections.singletonList( "" );
1267     }
1268 
1269     /*
1270      * (non-Javadoc)
1271      *
1272      * @see org.apache.maven.project.MavenProject#getTestResources()
1273      */
1274     public List getTestResources()
1275     {
1276         return Collections.singletonList( "" );
1277     }
1278 
1279     /*
1280      * (non-Javadoc)
1281      *
1282      * @see org.apache.maven.project.MavenProject#addResource(org.apache.maven.model.Resource)
1283      */
1284     public void addResource( Resource resource )
1285     {
1286 
1287     }
1288 
1289     /*
1290      * (non-Javadoc)
1291      *
1292      * @see org.apache.maven.project.MavenProject#addTestResource(org.apache.maven.model.Resource)
1293      */
1294     public void addTestResource( Resource resource )
1295     {
1296 
1297     }
1298 
1299     /*
1300      * (non-Javadoc)
1301      *
1302      * @see org.apache.maven.project.MavenProject#setReporting(org.apache.maven.model.Reporting)
1303      */
1304     public void setReporting( Reporting reporting )
1305     {
1306 
1307     }
1308 
1309     /*
1310      * (non-Javadoc)
1311      *
1312      * @see org.apache.maven.project.MavenProject#getReporting()
1313      */
1314     public Reporting getReporting()
1315     {
1316         return null;
1317     }
1318 
1319     /*
1320      * (non-Javadoc)
1321      *
1322      * @see org.apache.maven.project.MavenProject#setLicenses(java.util.List)
1323      */
1324     public void setLicenses( List list )
1325     {
1326 
1327     }
1328 
1329     /*
1330      * (non-Javadoc)
1331      *
1332      * @see org.apache.maven.project.MavenProject#getLicenses()
1333      */
1334     public List getLicenses()
1335     {
1336         return Collections.singletonList( "" );
1337     }
1338 
1339     /*
1340      * (non-Javadoc)
1341      *
1342      * @see org.apache.maven.project.MavenProject#addLicense(org.apache.maven.model.License)
1343      */
1344     public void addLicense( License license )
1345     {
1346 
1347     }
1348 
1349     /*
1350      * (non-Javadoc)
1351      *
1352      * @see org.apache.maven.project.MavenProject#setArtifacts(java.util.Set)
1353      */
1354     public void setArtifacts( Set set )
1355     {
1356         this.artifacts = set;
1357     }
1358 
1359     /*
1360      * (non-Javadoc)
1361      *
1362      * @see org.apache.maven.project.MavenProject#getArtifacts()
1363      */
1364     public Set getArtifacts()
1365     {
1366         if ( artifacts == null )
1367         {
1368             return Collections.EMPTY_SET;
1369         }
1370         else
1371         {
1372             return artifacts;
1373         }
1374     }
1375 
1376     /*
1377      * (non-Javadoc)
1378      *
1379      * @see org.apache.maven.project.MavenProject#getArtifactMap()
1380      */
1381     public Map getArtifactMap()
1382     {
1383         return Collections.singletonMap( "", "" );
1384     }
1385 
1386     /*
1387      * (non-Javadoc)
1388      *
1389      * @see org.apache.maven.project.MavenProject#setPluginArtifacts(java.util.Set)
1390      */
1391     public void setPluginArtifacts( Set set )
1392     {
1393 
1394     }
1395 
1396     /*
1397      * (non-Javadoc)
1398      *
1399      * @see org.apache.maven.project.MavenProject#getPluginArtifacts()
1400      */
1401     public Set getPluginArtifacts()
1402     {
1403         return Collections.singleton( "" );
1404     }
1405 
1406     /*
1407      * (non-Javadoc)
1408      *
1409      * @see org.apache.maven.project.MavenProject#getPluginArtifactMap()
1410      */
1411     public Map getPluginArtifactMap()
1412     {
1413         return Collections.singletonMap( "", "" );
1414     }
1415 
1416     /*
1417      * (non-Javadoc)
1418      *
1419      * @see org.apache.maven.project.MavenProject#setReportArtifacts(java.util.Set)
1420      */
1421     public void setReportArtifacts( Set set )
1422     {
1423 
1424     }
1425 
1426     /*
1427      * (non-Javadoc)
1428      *
1429      * @see org.apache.maven.project.MavenProject#getReportArtifacts()
1430      */
1431     public Set getReportArtifacts()
1432     {
1433         return Collections.singleton( "" );
1434     }
1435 
1436     /*
1437      * (non-Javadoc)
1438      *
1439      * @see org.apache.maven.project.MavenProject#getReportArtifactMap()
1440      */
1441     public Map getReportArtifactMap()
1442     {
1443         return Collections.singletonMap( "", "" );
1444     }
1445 
1446     /*
1447      * (non-Javadoc)
1448      *
1449      * @see org.apache.maven.project.MavenProject#setExtensionArtifacts(java.util.Set)
1450      */
1451     public void setExtensionArtifacts( Set set )
1452     {
1453 
1454     }
1455 
1456     /*
1457      * (non-Javadoc)
1458      *
1459      * @see org.apache.maven.project.MavenProject#getExtensionArtifacts()
1460      */
1461     public Set getExtensionArtifacts()
1462     {
1463         return Collections.singleton( "" );
1464     }
1465 
1466     /*
1467      * (non-Javadoc)
1468      *
1469      * @see org.apache.maven.project.MavenProject#getExtensionArtifactMap()
1470      */
1471     public Map getExtensionArtifactMap()
1472     {
1473         return Collections.singletonMap( "", "" );
1474     }
1475 
1476     /*
1477      * (non-Javadoc)
1478      *
1479      * @see org.apache.maven.project.MavenProject#setParentArtifact(org.apache.maven.artifact.Artifact)
1480      */
1481     public void setParentArtifact( Artifact artifact )
1482     {
1483 
1484     }
1485 
1486     /*
1487      * (non-Javadoc)
1488      *
1489      * @see org.apache.maven.project.MavenProject#getParentArtifact()
1490      */
1491     public Artifact getParentArtifact()
1492     {
1493         if (parent !=null)
1494         {
1495             return parent.getArtifact();
1496         }
1497         else
1498             return null;
1499 
1500     }
1501 
1502     /*
1503      * (non-Javadoc)
1504      *
1505      * @see org.apache.maven.project.MavenProject#getRepositories()
1506      */
1507     public List getRepositories()
1508     {
1509         return Collections.singletonList( "" );
1510     }
1511 
1512     /*
1513      * (non-Javadoc)
1514      *
1515      * @see org.apache.maven.project.MavenProject#getReportPlugins()
1516      */
1517     public List getReportPlugins()
1518     {
1519         return Collections.singletonList( "" );
1520     }
1521 
1522     /*
1523      * (non-Javadoc)
1524      *
1525      * @see org.apache.maven.project.MavenProject#getBuildPlugins()
1526      */
1527     public List getBuildPlugins()
1528     {
1529         return Collections.singletonList( "" );
1530     }
1531 
1532     /*
1533      * (non-Javadoc)
1534      *
1535      * @see org.apache.maven.project.MavenProject#getModules()
1536      */
1537     public List getModules()
1538     {
1539         return Collections.singletonList( "" );
1540     }
1541 
1542     /*
1543      * (non-Javadoc)
1544      *
1545      * @see org.apache.maven.project.MavenProject#getPluginManagement()
1546      */
1547     public PluginManagement getPluginManagement()
1548     {
1549         return null;
1550     }
1551 
1552     /*
1553      * (non-Javadoc)
1554      *
1555      * @see org.apache.maven.project.MavenProject#addPlugin(org.apache.maven.model.Plugin)
1556      */
1557     public void addPlugin( Plugin plugin )
1558     {
1559 
1560     }
1561 
1562     /*
1563      * (non-Javadoc)
1564      *
1565      * @see org.apache.maven.project.MavenProject#injectPluginManagementInfo(org.apache.maven.model.Plugin)
1566      */
1567     public void injectPluginManagementInfo( Plugin plugin )
1568     {
1569 
1570     }
1571 
1572     /*
1573      * (non-Javadoc)
1574      *
1575      * @see org.apache.maven.project.MavenProject#getCollectedProjects()
1576      */
1577     public List getCollectedProjects()
1578     {
1579         return collectedProjects;
1580     }
1581 
1582     /*
1583      * (non-Javadoc)
1584      *
1585      * @see org.apache.maven.project.MavenProject#setCollectedProjects(java.util.List)
1586      */
1587     public void setCollectedProjects( List list )
1588     {
1589         this.collectedProjects = list;
1590     }
1591 
1592     /*
1593      * (non-Javadoc)
1594      *
1595      * @see org.apache.maven.project.MavenProject#setPluginArtifactRepositories(java.util.List)
1596      */
1597     public void setPluginArtifactRepositories( List list )
1598     {
1599         this.pluginArtifactRepositories = list;
1600     }
1601 
1602     /*
1603      * (non-Javadoc)
1604      *
1605      * @see org.apache.maven.project.MavenProject#getPluginArtifactRepositories()
1606      */
1607     public List getPluginArtifactRepositories()
1608     {
1609         return pluginArtifactRepositories;
1610     }
1611 
1612     /*
1613      * (non-Javadoc)
1614      *
1615      * @see org.apache.maven.project.MavenProject#getDistributionManagementArtifactRepository()
1616      */
1617     public ArtifactRepository getDistributionManagementArtifactRepository()
1618     {
1619         return null;
1620     }
1621 
1622     /*
1623      * (non-Javadoc)
1624      *
1625      * @see org.apache.maven.project.MavenProject#getPluginRepositories()
1626      */
1627     public List getPluginRepositories()
1628     {
1629         return Collections.singletonList( "" );
1630     }
1631 
1632     /*
1633      * (non-Javadoc)
1634      *
1635      * @see org.apache.maven.project.MavenProject#setActiveProfiles(java.util.List)
1636      */
1637     public void setActiveProfiles( List list )
1638     {
1639         activeProfiles = list;
1640     }
1641 
1642     /*
1643      * (non-Javadoc)
1644      *
1645      * @see org.apache.maven.project.MavenProject#getActiveProfiles()
1646      */
1647     public List getActiveProfiles()
1648     {
1649         return activeProfiles;
1650     }
1651 
1652     /*
1653      * (non-Javadoc)
1654      *
1655      * @see org.apache.maven.project.MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
1656      */
1657     public void addAttachedArtifact( Artifact theArtifact )
1658     {
1659         if ( attachedArtifacts == null )
1660         {
1661             this.attachedArtifacts = Collections.singletonList( theArtifact );
1662         }
1663         else
1664         {
1665             attachedArtifacts.add( theArtifact );
1666         }
1667     }
1668 
1669     /*
1670      * (non-Javadoc)
1671      *
1672      * @see org.apache.maven.project.MavenProject#getAttachedArtifacts()
1673      */
1674     public List getAttachedArtifacts()
1675     {
1676         return attachedArtifacts;
1677     }
1678 
1679     /*
1680      * (non-Javadoc)
1681      *
1682      * @see org.apache.maven.project.MavenProject#getGoalConfiguration(java.lang.String, java.lang.String,
1683      *      java.lang.String, java.lang.String)
1684      */
1685     public Xpp3Dom getGoalConfiguration( String string, String string1, String string2, String string3 )
1686     {
1687         return null;
1688     }
1689 
1690     /*
1691      * (non-Javadoc)
1692      *
1693      * @see org.apache.maven.project.MavenProject#getReportConfiguration(java.lang.String, java.lang.String,
1694      *      java.lang.String)
1695      */
1696     public Xpp3Dom getReportConfiguration( String string, String string1, String string2 )
1697     {
1698         return null;
1699     }
1700 
1701     /*
1702      * (non-Javadoc)
1703      *
1704      * @see org.apache.maven.project.MavenProject#getExecutionProject()
1705      */
1706     public MavenProject getExecutionProject()
1707     {
1708         return null;
1709     }
1710 
1711     /*
1712      * (non-Javadoc)
1713      *
1714      * @see org.apache.maven.project.MavenProject#setExecutionProject(org.apache.maven.project.MavenProject)
1715      */
1716     public void setExecutionProject( MavenProject mavenProject )
1717     {
1718 
1719     }
1720 
1721     /*
1722      * (non-Javadoc)
1723      *
1724      * @see org.apache.maven.project.MavenProject#writeModel(java.io.Writer)
1725      */
1726     public void writeModel( Writer writer )
1727         throws IOException
1728     {
1729 
1730     }
1731 
1732     /*
1733      * (non-Javadoc)
1734      *
1735      * @see org.apache.maven.project.MavenProject#writeOriginalModel(java.io.Writer)
1736      */
1737     public void writeOriginalModel( Writer writer )
1738         throws IOException
1739     {
1740 
1741     }
1742 
1743     /*
1744      * (non-Javadoc)
1745      *
1746      * @see org.apache.maven.project.MavenProject#getDependencyArtifacts()
1747      */
1748     public Set getDependencyArtifacts()
1749     {
1750         return dependencyArtifacts;
1751     }
1752 
1753     /*
1754      * (non-Javadoc)
1755      *
1756      * @see org.apache.maven.project.MavenProject#setDependencyArtifacts(java.util.Set)
1757      */
1758     public void setDependencyArtifacts( Set set )
1759     {
1760         this.dependencyArtifacts = set;
1761     }
1762 
1763     /*
1764      * (non-Javadoc)
1765      *
1766      * @see org.apache.maven.project.MavenProject#setReleaseArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository)
1767      */
1768     public void setReleaseArtifactRepository( ArtifactRepository artifactRepository )
1769     {
1770         // this.releaseArtifactRepository = artifactRepository;
1771     }
1772 
1773     /*
1774      * (non-Javadoc)
1775      *
1776      * @see org.apache.maven.project.MavenProject#setSnapshotArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository)
1777      */
1778     public void setSnapshotArtifactRepository( ArtifactRepository artifactRepository )
1779     {
1780         // this.snapshotArtifactRepository = artifactRepository;
1781     }
1782 
1783     /*
1784      * (non-Javadoc)
1785      *
1786      * @see org.apache.maven.project.MavenProject#setOriginalModel(org.apache.maven.model.Model)
1787      */
1788     public void setOriginalModel( Model model )
1789     {
1790         this.originalModel = model;
1791     }
1792 
1793     /*
1794      * (non-Javadoc)
1795      *
1796      * @see org.apache.maven.project.MavenProject#getOriginalModel()
1797      */
1798     public Model getOriginalModel()
1799     {
1800         return originalModel;
1801     }
1802 
1803     /*
1804      * (non-Javadoc)
1805      *
1806      * @see org.apache.maven.project.MavenProject#getBuildExtensions()
1807      */
1808     public List getBuildExtensions()
1809     {
1810         return Collections.singletonList( "" );
1811     }
1812 
1813     /*
1814      * (non-Javadoc)
1815      *
1816      * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory,
1817      *      java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
1818      */
1819     public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
1820         throws InvalidDependencyVersionException
1821     {
1822         return Collections.EMPTY_SET;
1823     }
1824 
1825     /*
1826      * (non-Javadoc)
1827      *
1828      * @see org.apache.maven.project.MavenProject#addProjectReference(org.apache.maven.project.MavenProject)
1829      */
1830     public void addProjectReference( MavenProject mavenProject )
1831     {
1832 
1833     }
1834 
1835     /*
1836      * (non-Javadoc)
1837      *
1838      * @see org.apache.maven.project.MavenProject#attachArtifact(java.lang.String, java.lang.String, java.io.File)
1839      */
1840     public void attachArtifact( String string, String string1, File theFile )
1841     {
1842 
1843     }
1844 
1845     /*
1846      * (non-Javadoc)
1847      *
1848      * @see org.apache.maven.project.MavenProject#getProperties()
1849      */
1850     public Properties getProperties()
1851     {
1852         return this.properties;
1853     }
1854 
1855     /**
1856      * Sets the property.
1857      *
1858      * @param key the key
1859      * @param value the value
1860      */
1861     public void setProperty( String key, String value )
1862     {
1863         properties.setProperty( key, value );
1864     }
1865 
1866     /*
1867      * (non-Javadoc)
1868      *
1869      * @see org.apache.maven.project.MavenProject#getFilters()
1870      */
1871     public List getFilters()
1872     {
1873         return Collections.singletonList( "" );
1874     }
1875 
1876     /*
1877      * (non-Javadoc)
1878      *
1879      * @see org.apache.maven.project.MavenProject#getProjectReferences()
1880      */
1881     public Map getProjectReferences()
1882     {
1883         return Collections.singletonMap( "", "" );
1884     }
1885 
1886     /*
1887      * (non-Javadoc)
1888      *
1889      * @see org.apache.maven.project.MavenProject#isExecutionRoot()
1890      */
1891     public boolean isExecutionRoot()
1892     {
1893         return executionRoot;
1894     }
1895 
1896     /*
1897      * (non-Javadoc)
1898      *
1899      * @see org.apache.maven.project.MavenProject#setExecutionRoot(boolean)
1900      */
1901     public void setExecutionRoot( boolean b )
1902     {
1903         this.executionRoot = b;
1904     }
1905 
1906     /*
1907      * (non-Javadoc)
1908      *
1909      * @see org.apache.maven.project.MavenProject#getDefaultGoal()
1910      */
1911     public String getDefaultGoal()
1912     {
1913         return defaultGoal;
1914     }
1915 
1916     /*
1917      * (non-Javadoc)
1918      *
1919      * @see org.apache.maven.project.MavenProject#replaceWithActiveArtifact(org.apache.maven.artifact.Artifact)
1920      */
1921     public Artifact replaceWithActiveArtifact( Artifact theArtifact )
1922     {
1923         return null;
1924     }
1925 }