View Javadoc

1   package org.apache.maven.plugin.testing.stubs;
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.ArrayList;
26  import java.util.Collections;
27  import java.util.List;
28  import java.util.Map;
29  import java.util.Properties;
30  import java.util.Set;
31  
32  import org.apache.maven.artifact.Artifact;
33  import org.apache.maven.artifact.DependencyResolutionRequiredException;
34  import org.apache.maven.artifact.factory.ArtifactFactory;
35  import org.apache.maven.artifact.repository.ArtifactRepository;
36  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
37  import org.apache.maven.model.Build;
38  import org.apache.maven.model.CiManagement;
39  import org.apache.maven.model.Contributor;
40  import org.apache.maven.model.DependencyManagement;
41  import org.apache.maven.model.Developer;
42  import org.apache.maven.model.DistributionManagement;
43  import org.apache.maven.model.IssueManagement;
44  import org.apache.maven.model.License;
45  import org.apache.maven.model.MailingList;
46  import org.apache.maven.model.Model;
47  import org.apache.maven.model.Organization;
48  import org.apache.maven.model.Plugin;
49  import org.apache.maven.model.PluginManagement;
50  import org.apache.maven.model.Prerequisites;
51  import org.apache.maven.model.Reporting;
52  import org.apache.maven.model.Resource;
53  import org.apache.maven.model.Scm;
54  import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
55  import org.apache.maven.project.MavenProject;
56  import org.codehaus.plexus.PlexusTestCase;
57  import org.codehaus.plexus.util.ReaderFactory;
58  import org.codehaus.plexus.util.xml.Xpp3Dom;
59  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
60  
61  /**
62   * Very simple stub of <code>MavenProject</code> object, going to take a lot of work to make it
63   * useful as a stub though.
64   *
65   * @author jesse
66   * @version $Id: MavenProjectStub.java 785452 2009-06-17 00:00:18Z olamy $
67   */
68  public class MavenProjectStub
69      extends MavenProject
70  {
71      private String groupId;
72  
73      private String artifactId;
74  
75      private String name;
76  
77      private Model model;
78  
79      private MavenProject parent;
80  
81      private File file;
82  
83      private List collectedProjects;
84  
85      private List attachedArtifacts;
86  
87      private List compileSourceRoots;
88  
89      private List testCompileSourceRoots;
90  
91      private List scriptSourceRoots;
92  
93      private List pluginArtifactRepositories;
94  
95      private ArtifactRepository releaseArtifactRepository;
96  
97      private ArtifactRepository snapshotArtifactRepository;
98  
99      private List activeProfiles;
100 
101     private Set dependencyArtifacts;
102 
103     private Artifact artifact;
104 
105     private Map artifactMap;
106 
107     private Model originalModel;
108 
109     private Map pluginArtifactMap;
110 
111     private Map reportArtifactMap;
112 
113     private Map extensionArtifactMap;
114 
115     private Map projectReferences;
116 
117     private Build buildOverlay;
118 
119     private boolean executionRoot;
120 
121     private List compileArtifacts;
122 
123     private List compileDependencies;
124 
125     private List systemDependencies;
126 
127     private List testClasspathElements;
128 
129     private List testDependencies;
130 
131     private List systemClasspathElements;
132 
133     private List systemArtifacts;
134 
135     private List testArtifacts;
136 
137     private List runtimeArtifacts;
138 
139     private List runtimeDependencies;
140 
141     private List runtimeClasspathElements;
142 
143     private String modelVersion;
144 
145     private String packaging;
146 
147     private String inceptionYear;
148 
149     private String url;
150 
151     private String description;
152 
153     private String version;
154 
155     private String defaultGoal;
156 
157     private List licenses;
158 
159     private Build build;
160 
161     /**
162      * Default constructor
163      */
164     public MavenProjectStub()
165     {
166         this( new Model() );
167     }
168 
169     /**
170      * @param model the given model
171      */
172     public MavenProjectStub( Model model )
173     {
174         super( (Model) null );
175         this.model = model;
176     }
177 
178     /**
179      * Loads the model for this stub from the specified POM. For convenience, any checked exception caused by I/O or
180      * parser errors will be wrapped into an unchecked exception.
181      * 
182      * @param pomFile The path to the POM file to load, must not be <code>null</code>. If this path is relative, it
183      *            is resolved against the return value of {@link #getBasedir()}.
184      */
185     protected void readModel( File pomFile )
186     {
187         if ( !pomFile.isAbsolute() )
188         {
189             pomFile = new File( getBasedir(), pomFile.getPath() );
190         }
191         try
192         {
193             setModel( new MavenXpp3Reader().read( ReaderFactory.newXmlReader( pomFile ) ) );
194         }
195         catch ( IOException e )
196         {
197             throw new RuntimeException( "Failed to read POM file: " + pomFile, e );
198         }
199         catch ( XmlPullParserException e )
200         {
201             throw new RuntimeException( "Failed to parse POM file: " + pomFile, e );
202         }
203     }
204 
205     /**
206      * No project model is associated
207      *
208      * @param project the given project
209      */
210     public MavenProjectStub( MavenProject project )
211     {
212         super( (Model) null );
213     }
214 
215     /**
216      * @param mavenProject
217      * @return an empty String
218      * @throws IOException if any
219      */
220     public String getModulePathAdjustment( MavenProject mavenProject )
221         throws IOException
222     {
223         return "";
224     }
225 
226     /** {@inheritDoc} */
227     public Artifact getArtifact()
228     {
229         return artifact;
230     }
231 
232     /** {@inheritDoc} */
233     public void setArtifact( Artifact artifact )
234     {
235         this.artifact = artifact;
236     }
237 
238     /** {@inheritDoc} */
239     public Model getModel()
240     {
241         return model;
242     }
243 
244     /** {@inheritDoc} */
245     public MavenProject getParent()
246     {
247         return parent;
248     }
249 
250     /** {@inheritDoc} */
251     public void setParent( MavenProject mavenProject )
252     {
253         this.parent = mavenProject;
254     }
255 
256     /**
257      * By default, do nothing.
258      *
259      * @see org.apache.maven.project.MavenProject#setRemoteArtifactRepositories(java.util.List)
260      */
261     public void setRemoteArtifactRepositories( List list )
262     {
263         // nop
264     }
265 
266     /**
267      * By default, return <code>Collections.EMPTY_LIST</code>.
268      *
269      * @see org.apache.maven.project.MavenProject#getRemoteArtifactRepositories()
270      */
271     public List getRemoteArtifactRepositories()
272     {
273         return Collections.EMPTY_LIST;
274     }
275 
276     /** {@inheritDoc} */
277     public boolean hasParent()
278     {
279         if ( parent != null )
280         {
281             return true;
282         }
283 
284         return false;
285     }
286 
287     /** {@inheritDoc} */
288     public File getFile()
289     {
290         return file;
291     }
292 
293     /** {@inheritDoc} */
294     public void setFile( File file )
295     {
296         this.file = file;
297     }
298 
299     /** {@inheritDoc} */
300     public File getBasedir()
301     {
302         return new File( PlexusTestCase.getBasedir() );
303     }
304 
305     /**
306      * By default, do nothing.
307      *
308      * @see org.apache.maven.project.MavenProject#setDependencies(java.util.List)
309      */
310     public void setDependencies( List list )
311     {
312         // nop
313     }
314 
315     /**
316      * By default, return <code>Collections.EMPTY_LIST</code>.
317      *
318      * @see org.apache.maven.project.MavenProject#getDependencies()
319      */
320     public List getDependencies()
321     {
322         return Collections.EMPTY_LIST;
323     }
324 
325     /**
326      * By default, return <code>null</code>.
327      *
328      * @see org.apache.maven.project.MavenProject#getDependencyManagement()
329      */
330     public DependencyManagement getDependencyManagement()
331     {
332         return null;
333     }
334 
335     /** {@inheritDoc} */
336     public void addCompileSourceRoot( String string )
337     {
338         if ( compileSourceRoots == null )
339         {
340             compileSourceRoots = new ArrayList( Collections.singletonList( string ) );
341         }
342         else
343         {
344             compileSourceRoots.add( string );
345         }
346     }
347 
348     /** {@inheritDoc} */
349     public void addScriptSourceRoot( String string )
350     {
351         if ( scriptSourceRoots == null )
352         {
353             scriptSourceRoots = new ArrayList( Collections.singletonList( string ) );
354         }
355         else
356         {
357             scriptSourceRoots.add( string );
358         }
359     }
360 
361     /** {@inheritDoc} */
362     public void addTestCompileSourceRoot( String string )
363     {
364         if ( testCompileSourceRoots == null )
365         {
366             testCompileSourceRoots = new ArrayList( Collections.singletonList( string ) );
367         }
368         else
369         {
370             testCompileSourceRoots.add( string );
371         }
372     }
373 
374     /** {@inheritDoc} */
375     public List getCompileSourceRoots()
376     {
377         return compileSourceRoots;
378     }
379 
380     /** {@inheritDoc} */
381     public List getScriptSourceRoots()
382     {
383         return scriptSourceRoots;
384     }
385 
386     /** {@inheritDoc} */
387     public List getTestCompileSourceRoots()
388     {
389         return testCompileSourceRoots;
390     }
391 
392     /** {@inheritDoc} */
393     public List getCompileClasspathElements()
394         throws DependencyResolutionRequiredException
395     {
396         return compileSourceRoots;
397     }
398 
399     /**
400      * @param compileArtifacts
401      */
402     public void setCompileArtifacts( List compileArtifacts )
403     {
404         this.compileArtifacts = compileArtifacts;
405     }
406 
407     /** {@inheritDoc} */
408     public List getCompileArtifacts()
409     {
410         return compileArtifacts;
411     }
412 
413     /** {@inheritDoc} */
414     public List getCompileDependencies()
415     {
416         return compileDependencies;
417     }
418 
419     /** {@inheritDoc} */
420     public List getTestClasspathElements()
421         throws DependencyResolutionRequiredException
422     {
423         return testClasspathElements;
424     }
425 
426     /** {@inheritDoc} */
427     public List getTestArtifacts()
428     {
429         return testArtifacts;
430     }
431 
432     /** {@inheritDoc} */
433     public List getTestDependencies()
434     {
435         return testDependencies;
436     }
437 
438     /** {@inheritDoc} */
439     public List getRuntimeClasspathElements()
440         throws DependencyResolutionRequiredException
441     {
442         return runtimeClasspathElements;
443     }
444 
445     /** {@inheritDoc} */
446     public List getRuntimeArtifacts()
447     {
448         return runtimeArtifacts;
449     }
450 
451     /** {@inheritDoc} */
452     public List getRuntimeDependencies()
453     {
454         return runtimeDependencies;
455     }
456 
457     /** {@inheritDoc} */
458     public List getSystemClasspathElements()
459         throws DependencyResolutionRequiredException
460     {
461         return systemClasspathElements;
462     }
463 
464     /** {@inheritDoc} */
465     public List getSystemArtifacts()
466     {
467         return systemArtifacts;
468     }
469 
470     /**
471      * @param runtimeClasspathElements
472      */
473     public void setRuntimeClasspathElements( List runtimeClasspathElements )
474     {
475         this.runtimeClasspathElements = runtimeClasspathElements;
476     }
477 
478     /**
479      * @param attachedArtifacts
480      */
481     public void setAttachedArtifacts( List attachedArtifacts )
482     {
483         this.attachedArtifacts = attachedArtifacts;
484     }
485 
486     /**
487      * @param compileSourceRoots
488      */
489     public void setCompileSourceRoots( List compileSourceRoots )
490     {
491         this.compileSourceRoots = compileSourceRoots;
492     }
493 
494     /**
495      * @param testCompileSourceRoots
496      */
497     public void setTestCompileSourceRoots( List testCompileSourceRoots )
498     {
499         this.testCompileSourceRoots = testCompileSourceRoots;
500     }
501 
502     /**
503      * @param scriptSourceRoots
504      */
505     public void setScriptSourceRoots( List scriptSourceRoots )
506     {
507         this.scriptSourceRoots = scriptSourceRoots;
508     }
509 
510     /**
511      * @param artifactMap
512      */
513     public void setArtifactMap( Map artifactMap )
514     {
515         this.artifactMap = artifactMap;
516     }
517 
518     /**
519      * @param pluginArtifactMap
520      */
521     public void setPluginArtifactMap( Map pluginArtifactMap )
522     {
523         this.pluginArtifactMap = pluginArtifactMap;
524     }
525 
526     /**
527      * @param reportArtifactMap
528      */
529     public void setReportArtifactMap( Map reportArtifactMap )
530     {
531         this.reportArtifactMap = reportArtifactMap;
532     }
533 
534     /**
535      * @param extensionArtifactMap
536      */
537     public void setExtensionArtifactMap( Map extensionArtifactMap )
538     {
539         this.extensionArtifactMap = extensionArtifactMap;
540     }
541 
542     /**
543      * @param projectReferences
544      */
545     public void setProjectReferences( Map projectReferences )
546     {
547         this.projectReferences = projectReferences;
548     }
549 
550     /**
551      * @param buildOverlay
552      */
553     public void setBuildOverlay( Build buildOverlay )
554     {
555         this.buildOverlay = buildOverlay;
556     }
557 
558     /**
559      * @param compileDependencies
560      */
561     public void setCompileDependencies( List compileDependencies )
562     {
563         this.compileDependencies = compileDependencies;
564     }
565 
566     /**
567      * @param systemDependencies
568      */
569     public void setSystemDependencies( List systemDependencies )
570     {
571         this.systemDependencies = systemDependencies;
572     }
573 
574     /**
575      * @param testClasspathElements
576      */
577     public void setTestClasspathElements( List testClasspathElements )
578     {
579         this.testClasspathElements = testClasspathElements;
580     }
581 
582     /**
583      * @param testDependencies
584      */
585     public void setTestDependencies( List testDependencies )
586     {
587         this.testDependencies = testDependencies;
588     }
589 
590     /**
591      * @param systemClasspathElements
592      */
593     public void setSystemClasspathElements( List systemClasspathElements )
594     {
595         this.systemClasspathElements = systemClasspathElements;
596     }
597 
598     /**
599      * @param systemArtifacts
600      */
601     public void setSystemArtifacts( List systemArtifacts )
602     {
603         this.systemArtifacts = systemArtifacts;
604     }
605 
606     /**
607      * @param testArtifacts
608      */
609     public void setTestArtifacts( List testArtifacts )
610     {
611         this.testArtifacts = testArtifacts;
612     }
613 
614     /**
615      * @param runtimeArtifacts
616      */
617     public void setRuntimeArtifacts( List runtimeArtifacts )
618     {
619         this.runtimeArtifacts = runtimeArtifacts;
620     }
621 
622     /**
623      * @param runtimeDependencies
624      */
625     public void setRuntimeDependencies( List runtimeDependencies )
626     {
627         this.runtimeDependencies = runtimeDependencies;
628     }
629 
630     /**
631      * @param model
632      */
633     public void setModel( Model model )
634     {
635         this.model = model;
636     }
637 
638     /** {@inheritDoc} */
639     public List getSystemDependencies()
640     {
641         return systemDependencies;
642     }
643 
644     /** {@inheritDoc} */
645     public void setModelVersion( String string )
646     {
647         this.modelVersion = string;
648     }
649 
650     /** {@inheritDoc} */
651     public String getModelVersion()
652     {
653         return modelVersion;
654     }
655 
656     /**
657      * By default, return an empty String.
658      *
659      * @see org.apache.maven.project.MavenProject#getId()
660      */
661     public String getId()
662     {
663         return "";
664     }
665 
666     /** {@inheritDoc} */
667     public void setGroupId( String string )
668     {
669         this.groupId = string;
670     }
671 
672     /** {@inheritDoc} */
673     public String getGroupId()
674     {
675         return groupId;
676     }
677 
678     /** {@inheritDoc} */
679     public void setArtifactId( String string )
680     {
681         this.artifactId = string;
682     }
683 
684     /** {@inheritDoc} */
685     public String getArtifactId()
686     {
687         return artifactId;
688     }
689 
690     /** {@inheritDoc} */
691     public void setName( String string )
692     {
693         this.name = string;
694     }
695 
696     /** {@inheritDoc} */
697     public String getName()
698     {
699         return name;
700     }
701 
702     /** {@inheritDoc} */
703     public void setVersion( String string )
704     {
705         this.version = string;
706     }
707 
708     /** {@inheritDoc} */
709     public String getVersion()
710     {
711         return version;
712     }
713 
714     /** {@inheritDoc} */
715     public String getPackaging()
716     {
717         return packaging;
718     }
719 
720     /** {@inheritDoc} */
721     public void setPackaging( String string )
722     {
723         this.packaging = string;
724     }
725 
726     /** {@inheritDoc} */
727     public void setInceptionYear( String string )
728     {
729         this.inceptionYear = string;
730     }
731 
732     /** {@inheritDoc} */
733     public String getInceptionYear()
734     {
735         return inceptionYear;
736     }
737 
738     /** {@inheritDoc} */
739     public void setUrl( String string )
740     {
741         this.url = string;
742     }
743 
744     /** {@inheritDoc} */
745     public String getUrl()
746     {
747         return url;
748     }
749 
750     /**
751      * By default, return <code>null</code>.
752      *
753      * @see org.apache.maven.project.MavenProject#getPrerequisites()
754      */
755     public Prerequisites getPrerequisites()
756     {
757         return null;
758     }
759 
760     /**
761      * By default, do nothing.
762      *
763      * @see org.apache.maven.project.MavenProject#setIssueManagement(org.apache.maven.model.IssueManagement)
764      */
765     public void setIssueManagement( IssueManagement issueManagement )
766     {
767         // nop
768     }
769 
770     /**
771      * By default, return <code>null</code>.
772      *
773      * @see org.apache.maven.project.MavenProject#getCiManagement()
774      */
775     public CiManagement getCiManagement()
776     {
777         return null;
778     }
779 
780     /**
781      * By default, do nothing.
782      *
783      * @see org.apache.maven.project.MavenProject#setCiManagement(org.apache.maven.model.CiManagement)
784      */
785     public void setCiManagement( CiManagement ciManagement )
786     {
787         // nop
788     }
789 
790     /**
791      * By default, return <code>null</code>.
792      *
793      * @see org.apache.maven.project.MavenProject#getIssueManagement()
794      */
795     public IssueManagement getIssueManagement()
796     {
797         return null;
798     }
799 
800     /**
801      * By default, do nothing.
802      *
803      * @see org.apache.maven.project.MavenProject#setDistributionManagement(org.apache.maven.model.DistributionManagement)
804      */
805     public void setDistributionManagement( DistributionManagement distributionManagement )
806     {
807         // nop
808     }
809 
810     /**
811      * By default, return <code>null</code>.
812      *
813      * @see org.apache.maven.project.MavenProject#getDistributionManagement()
814      */
815     public DistributionManagement getDistributionManagement()
816     {
817         return null;
818     }
819 
820     /** {@inheritDoc} */
821     public void setDescription( String string )
822     {
823         this.description = string;
824     }
825 
826     /** {@inheritDoc} */
827     public String getDescription()
828     {
829         return description;
830     }
831 
832     /**
833      * By default, do nothing.
834      *
835      * @see org.apache.maven.project.MavenProject#setOrganization(org.apache.maven.model.Organization)
836      */
837     public void setOrganization( Organization organization )
838     {
839         // nop
840     }
841 
842     /**
843      * By default, return <code>null</code>.
844      *
845      * @see org.apache.maven.project.MavenProject#getOrganization()
846      */
847     public Organization getOrganization()
848     {
849         return null;
850     }
851 
852     /**
853      * By default, do nothing.
854      *
855      * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
856      */
857     public void setScm( Scm scm )
858     {
859         // nop
860     }
861 
862     /**
863      * By default, return <code>null</code>.
864      *
865      * @see org.apache.maven.project.MavenProject#getScm()
866      */
867     public Scm getScm()
868     {
869         return null;
870     }
871 
872     /**
873      * By default, do nothing.
874      *
875      * @see org.apache.maven.project.MavenProject#setMailingLists(java.util.List)
876      */
877     public void setMailingLists( List list )
878     {
879         // nop
880     }
881 
882     /**
883      * By default, return <code>Collections.EMPTY_LIST</code>.
884      *
885      * @see org.apache.maven.project.MavenProject#getMailingLists()
886      */
887     public List getMailingLists()
888     {
889         return Collections.EMPTY_LIST;
890     }
891 
892     /**
893      * By default, do nothing.
894      *
895      * @see org.apache.maven.project.MavenProject#addMailingList(org.apache.maven.model.MailingList)
896      */
897     public void addMailingList( MailingList mailingList )
898     {
899         // nop
900     }
901 
902     /**
903      * By default, do nothing.
904      *
905      * @see org.apache.maven.project.MavenProject#setDevelopers(java.util.List)
906      */
907     public void setDevelopers( List list )
908     {
909         // nop
910     }
911 
912     /**
913      * By default, return <code>Collections.EMPTY_LIST</code>.
914      *
915      * @see org.apache.maven.project.MavenProject#getDevelopers()
916      */
917     public List getDevelopers()
918     {
919         return Collections.EMPTY_LIST;
920     }
921 
922     /**
923      * By default, do nothing.
924      *
925      * @see org.apache.maven.project.MavenProject#addDeveloper(org.apache.maven.model.Developer)
926      */
927     public void addDeveloper( Developer developer )
928     {
929         // nop
930     }
931 
932     /**
933      * By default, do nothing.
934      *
935      * @see org.apache.maven.project.MavenProject#setContributors(java.util.List)
936      */
937     public void setContributors( List list )
938     {
939         // nop
940     }
941 
942     /**
943      * By default, return <code>Collections.EMPTY_LIST</code>.
944      *
945      * @see org.apache.maven.project.MavenProject#getContributors()
946      */
947     public List getContributors()
948     {
949         return Collections.EMPTY_LIST;
950     }
951 
952     /**
953      * By default, do nothing.
954      *
955      * @see org.apache.maven.project.MavenProject#addContributor(org.apache.maven.model.Contributor)
956      */
957     public void addContributor( Contributor contributor )
958     {
959         // nop
960     }
961 
962     /** {@inheritDoc} */
963     public void setBuild( Build build )
964     {
965         this.build = build;
966     }
967 
968     /** {@inheritDoc} */
969     public Build getBuild()
970     {
971         return build;
972     }
973 
974     /**
975      * By default, return <code>Collections.EMPTY_LIST</code>.
976      *
977      * @see org.apache.maven.project.MavenProject#getResources()
978      */
979     public List getResources()
980     {
981         return Collections.EMPTY_LIST;
982     }
983 
984     /**
985      * By default, return <code>Collections.EMPTY_LIST</code>.
986      *
987      * @see org.apache.maven.project.MavenProject#getTestResources()
988      */
989     public List getTestResources()
990     {
991         return Collections.EMPTY_LIST;
992     }
993 
994     /**
995      * By default, do nothing.
996      *
997      * @see org.apache.maven.project.MavenProject#addResource(org.apache.maven.model.Resource)
998      */
999     public void addResource( Resource resource )
1000     {
1001         // nop
1002     }
1003 
1004     /**
1005      * By default, do nothing.
1006      *
1007      * @see org.apache.maven.project.MavenProject#addTestResource(org.apache.maven.model.Resource)
1008      */
1009     public void addTestResource( Resource resource )
1010     {
1011         // nop
1012     }
1013 
1014     /**
1015      * By default, do nothing.
1016      *
1017      * @see org.apache.maven.project.MavenProject#setReporting(org.apache.maven.model.Reporting)
1018      */
1019     public void setReporting( Reporting reporting )
1020     {
1021         // nop
1022     }
1023 
1024     /**
1025      * By default, return <code>null</code>.
1026      *
1027      * @see org.apache.maven.project.MavenProject#getReporting()
1028      */
1029     public Reporting getReporting()
1030     {
1031         return null;
1032     }
1033 
1034     /** {@inheritDoc} */
1035     public void setLicenses( List licenses )
1036     {
1037         this.licenses = licenses;
1038     }
1039 
1040     /** {@inheritDoc} */
1041     public List getLicenses()
1042     {
1043         return licenses;
1044     }
1045 
1046     /**
1047      * By default, do nothing.
1048      *
1049      * @see org.apache.maven.project.MavenProject#addLicense(org.apache.maven.model.License)
1050      */
1051     public void addLicense( License license )
1052     {
1053         // nop
1054     }
1055 
1056     /**
1057      * By default, do nothing.
1058      *
1059      * @see org.apache.maven.project.MavenProject#setArtifacts(java.util.Set)
1060      */
1061     public void setArtifacts( Set set )
1062     {
1063         // nop
1064     }
1065 
1066     /**
1067      * By default, return <code>Collections.EMPTY_SET</code>.
1068      *
1069      * @see org.apache.maven.project.MavenProject#getArtifacts()
1070      */
1071     public Set getArtifacts()
1072     {
1073         return Collections.EMPTY_SET;
1074     }
1075 
1076     /**
1077      * By default, return <code>Collections.EMPTY_MAP</code>.
1078      *
1079      * @see org.apache.maven.project.MavenProject#getArtifactMap()
1080      */
1081     public Map getArtifactMap()
1082     {
1083         return Collections.EMPTY_MAP;
1084     }
1085 
1086     /**
1087      * By default, do nothing.
1088      *
1089      * @see org.apache.maven.project.MavenProject#setPluginArtifacts(java.util.Set)
1090      */
1091     public void setPluginArtifacts( Set set )
1092     {
1093         // nop
1094     }
1095 
1096     /**
1097      * By default, return <code>Collections.EMPTY_SET</code>.
1098      *
1099      * @see org.apache.maven.project.MavenProject#getPluginArtifacts()
1100      */
1101     public Set getPluginArtifacts()
1102     {
1103         return Collections.EMPTY_SET;
1104     }
1105 
1106     /**
1107      * By default, return <code>Collections.EMPTY_MAP</code>.
1108      *
1109      * @see org.apache.maven.project.MavenProject#getPluginArtifactMap()
1110      */
1111     public Map getPluginArtifactMap()
1112     {
1113         return Collections.EMPTY_MAP;
1114     }
1115 
1116     /**
1117      * By default, do nothing.
1118      *
1119      * @see org.apache.maven.project.MavenProject#setReportArtifacts(java.util.Set)
1120      */
1121     public void setReportArtifacts( Set set )
1122     {
1123         // nop
1124     }
1125 
1126     /**
1127      * By default, return <code>Collections.EMPTY_SET</code>.
1128      *
1129      * @see org.apache.maven.project.MavenProject#getReportArtifacts()
1130      */
1131     public Set getReportArtifacts()
1132     {
1133         return Collections.EMPTY_SET;
1134     }
1135 
1136     /**
1137      * By default, return <code>Collections.EMPTY_MAP</code>.
1138      *
1139      * @see org.apache.maven.project.MavenProject#getReportArtifactMap()
1140      */
1141     public Map getReportArtifactMap()
1142     {
1143         return Collections.EMPTY_MAP;
1144     }
1145 
1146     /**
1147      * By default, do nothing.
1148      *
1149      * @see org.apache.maven.project.MavenProject#setExtensionArtifacts(java.util.Set)
1150      */
1151     public void setExtensionArtifacts( Set set )
1152     {
1153         // nop
1154     }
1155 
1156     /**
1157      * By default, return <code>Collections.EMPTY_SET</code>.
1158      *
1159      * @see org.apache.maven.project.MavenProject#getExtensionArtifacts()
1160      */
1161     public Set getExtensionArtifacts()
1162     {
1163         return Collections.EMPTY_SET;
1164     }
1165 
1166     /**
1167      * By default, return <code>Collections.EMPTY_MAP</code>.
1168      *
1169      * @see org.apache.maven.project.MavenProject#getExtensionArtifactMap()
1170      */
1171     public Map getExtensionArtifactMap()
1172     {
1173         return Collections.EMPTY_MAP;
1174     }
1175 
1176     /**
1177      * By default, do nothing.
1178      *
1179      * @see org.apache.maven.project.MavenProject#setParentArtifact(org.apache.maven.artifact.Artifact)
1180      */
1181     public void setParentArtifact( Artifact artifact )
1182     {
1183         // nop
1184     }
1185 
1186     /**
1187      * By default, return <code>null</code>.
1188      *
1189      * @see org.apache.maven.project.MavenProject#getParentArtifact()
1190      */
1191     public Artifact getParentArtifact()
1192     {
1193         return null;
1194     }
1195 
1196     /**
1197      * By default, return <code>Collections.EMPTY_LIST</code>.
1198      *
1199      * @see org.apache.maven.project.MavenProject#getRepositories()
1200      */
1201     public List getRepositories()
1202     {
1203         return Collections.EMPTY_LIST;
1204     }
1205 
1206     /**
1207      * By default, return <code>Collections.EMPTY_LIST</code>.
1208      *
1209      * @see org.apache.maven.project.MavenProject#getReportPlugins()
1210      */
1211     public List getReportPlugins()
1212     {
1213         return Collections.EMPTY_LIST;
1214     }
1215 
1216     /**
1217      * By default, return <code>Collections.EMPTY_LIST</code>.
1218      *
1219      * @see org.apache.maven.project.MavenProject#getBuildPlugins()
1220      */
1221     public List getBuildPlugins()
1222     {
1223         return Collections.EMPTY_LIST;
1224     }
1225 
1226     /**
1227      * By default, return <code>Collections.EMPTY_LIST</code>.
1228      *
1229      * @see org.apache.maven.project.MavenProject#getModules()
1230      */
1231     public List getModules()
1232     {
1233         return Collections.EMPTY_LIST;
1234     }
1235 
1236     /**
1237      * By default, return <code>null</code>.
1238      *
1239      * @see org.apache.maven.project.MavenProject#getPluginManagement()
1240      */
1241     public PluginManagement getPluginManagement()
1242     {
1243         return null;
1244     }
1245 
1246     /**
1247      * By default, do nothing.
1248      *
1249      * @see org.apache.maven.project.MavenProject#addPlugin(org.apache.maven.model.Plugin)
1250      */
1251     public void addPlugin( Plugin plugin )
1252     {
1253         // nop
1254     }
1255 
1256     /**
1257      * By default, do nothing.
1258      *
1259      * @param plugin
1260      */
1261     public void injectPluginManagementInfo( Plugin plugin )
1262     {
1263         // nop
1264     }
1265 
1266     /** {@inheritDoc} */
1267     public List getCollectedProjects()
1268     {
1269         return collectedProjects;
1270     }
1271 
1272     /** {@inheritDoc} */
1273     public void setCollectedProjects( List list )
1274     {
1275         this.collectedProjects = list;
1276     }
1277 
1278     /** {@inheritDoc} */
1279     public void setPluginArtifactRepositories( List list )
1280     {
1281         this.pluginArtifactRepositories = list;
1282     }
1283 
1284     /** {@inheritDoc} */
1285     public List getPluginArtifactRepositories()
1286     {
1287         return pluginArtifactRepositories;
1288     }
1289 
1290     /**
1291      * By default, return <code>null</code>.
1292      *
1293      * @see org.apache.maven.project.MavenProject#getDistributionManagementArtifactRepository()
1294      */
1295     public ArtifactRepository getDistributionManagementArtifactRepository()
1296     {
1297         return null;
1298     }
1299 
1300     /**
1301      * By default, return <code>Collections.EMPTY_LIST</code>.
1302      *
1303      * @see org.apache.maven.project.MavenProject#getPluginRepositories()
1304      */
1305     public List getPluginRepositories()
1306     {
1307         return Collections.EMPTY_LIST;
1308     }
1309 
1310     /** {@inheritDoc} */
1311     public void setActiveProfiles( List list )
1312     {
1313         activeProfiles = list;
1314     }
1315 
1316     /** {@inheritDoc} */
1317     public List getActiveProfiles()
1318     {
1319         return activeProfiles;
1320     }
1321 
1322     /** {@inheritDoc} */
1323     public void addAttachedArtifact( Artifact artifact )
1324     {
1325         if ( attachedArtifacts == null )
1326         {
1327             this.attachedArtifacts = new ArrayList( Collections.singletonList( artifact ) );
1328         }
1329         else
1330         {
1331             attachedArtifacts.add( artifact );
1332         }
1333     }
1334 
1335     /** {@inheritDoc} */
1336     public List getAttachedArtifacts()
1337     {
1338         return attachedArtifacts;
1339     }
1340 
1341     /**
1342      * By default, return <code>null</code>.
1343      *
1344      * @see org.apache.maven.project.MavenProject#getGoalConfiguration(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
1345      */
1346     public Xpp3Dom getGoalConfiguration( String string, String string1, String string2, String string3 )
1347     {
1348         return null;
1349     }
1350 
1351     /**
1352      * By default, return <code>null</code>.
1353      *
1354      * @see org.apache.maven.project.MavenProject#getReportConfiguration(java.lang.String, java.lang.String, java.lang.String)
1355      */
1356     public Xpp3Dom getReportConfiguration( String string, String string1, String string2 )
1357     {
1358         return null;
1359     }
1360 
1361     /**
1362      * By default, return <code>null</code>.
1363      *
1364      * @see org.apache.maven.project.MavenProject#getExecutionProject()
1365      */
1366     public MavenProject getExecutionProject()
1367     {
1368         return null;
1369     }
1370 
1371     /**
1372      * By default, do nothing.
1373      *
1374      * @see org.apache.maven.project.MavenProject#setExecutionProject(org.apache.maven.project.MavenProject)
1375      */
1376     public void setExecutionProject( MavenProject mavenProject )
1377     {
1378         // nop
1379     }
1380 
1381     /**
1382      * By default, do nothing.
1383      *
1384      * @see org.apache.maven.project.MavenProject#writeModel(java.io.Writer)
1385      */
1386     public void writeModel( Writer writer )
1387         throws IOException
1388     {
1389         // nop
1390     }
1391 
1392     /**
1393      * By default, do nothing.
1394      *
1395      * @see org.apache.maven.project.MavenProject#writeOriginalModel(java.io.Writer)
1396      */
1397     public void writeOriginalModel( Writer writer )
1398         throws IOException
1399     {
1400         // nop
1401     }
1402 
1403     /** {@inheritDoc} */
1404     public Set getDependencyArtifacts()
1405     {
1406         return dependencyArtifacts;
1407     }
1408 
1409     /** {@inheritDoc} */
1410     public void setDependencyArtifacts( Set set )
1411     {
1412         this.dependencyArtifacts = set;
1413     }
1414 
1415     /** {@inheritDoc} */
1416     public void setReleaseArtifactRepository( ArtifactRepository artifactRepository )
1417     {
1418         this.releaseArtifactRepository = artifactRepository;
1419     }
1420 
1421     /** {@inheritDoc} */
1422     public void setSnapshotArtifactRepository( ArtifactRepository artifactRepository )
1423     {
1424         this.snapshotArtifactRepository = artifactRepository;
1425     }
1426 
1427     /** {@inheritDoc} */
1428     public void setOriginalModel( Model model )
1429     {
1430         this.originalModel = model;
1431     }
1432 
1433     /** {@inheritDoc} */
1434     public Model getOriginalModel()
1435     {
1436         return originalModel;
1437     }
1438 
1439     /**
1440      * By default, return <code>Collections.EMPTY_LIST</code>.
1441      *
1442      * @see org.apache.maven.project.MavenProject#getBuildExtensions()
1443      */
1444     public List getBuildExtensions()
1445     {
1446         return Collections.EMPTY_LIST;
1447     }
1448 
1449     /**
1450      * By default, return <code>Collections.EMPTY_SET</code>.
1451      *
1452      * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory, java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
1453      */
1454     public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
1455     {
1456         return Collections.EMPTY_SET;
1457     }
1458 
1459     /**
1460      * By default, do nothing.
1461      *
1462      * @see org.apache.maven.project.MavenProject#addProjectReference(org.apache.maven.project.MavenProject)
1463      */
1464     public void addProjectReference( MavenProject mavenProject )
1465     {
1466         // nop
1467     }
1468 
1469     /**
1470      * By default, do nothing.
1471      *
1472      * @see org.apache.maven.project.MavenProject#attachArtifact(java.lang.String, java.lang.String, java.io.File)
1473      */
1474     public void attachArtifact( String string, String string1, File file )
1475     {
1476         // nop
1477     }
1478 
1479     /**
1480      * By default, return a new instance of <code>Properties</code>.
1481      *
1482      * @see org.apache.maven.project.MavenProject#getProperties()
1483      */
1484     public Properties getProperties()
1485     {
1486         return new Properties();
1487     }
1488 
1489     /**
1490      * By default, return <code>Collections.EMPTY_LIST</code>.
1491      *
1492      * @see org.apache.maven.project.MavenProject#getFilters()
1493      */
1494     public List getFilters()
1495     {
1496         return Collections.EMPTY_LIST;
1497     }
1498 
1499     /**
1500      * By default, return <code>Collections.EMPTY_MAP</code>.
1501      *
1502      * @see org.apache.maven.project.MavenProject#getProjectReferences()
1503      */
1504     public Map getProjectReferences()
1505     {
1506         return Collections.EMPTY_MAP;
1507     }
1508 
1509     /** {@inheritDoc} */
1510     public boolean isExecutionRoot()
1511     {
1512         return executionRoot;
1513     }
1514 
1515     /** {@inheritDoc} */
1516     public void setExecutionRoot( boolean b )
1517     {
1518         this.executionRoot = b;
1519     }
1520 
1521     /** {@inheritDoc} */
1522     public String getDefaultGoal()
1523     {
1524         return defaultGoal;
1525     }
1526 
1527     /**
1528      * By default, return <code>null</code>.
1529      *
1530      * @see org.apache.maven.project.MavenProject#replaceWithActiveArtifact(org.apache.maven.artifact.Artifact)
1531      */
1532     public Artifact replaceWithActiveArtifact( Artifact artifact )
1533     {
1534         return null;
1535     }
1536 }