001    /*
002     * Copyright (C) 2006-2007 the original author or authors.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.codehaus.gmaven.plugin.execute;
018    
019    import org.apache.maven.project.MavenProject;
020    import org.apache.maven.project.artifact.InvalidDependencyVersionException;
021    import org.apache.maven.artifact.Artifact;
022    import org.apache.maven.artifact.DependencyResolutionRequiredException;
023    import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
024    import org.apache.maven.artifact.factory.ArtifactFactory;
025    import org.apache.maven.artifact.repository.ArtifactRepository;
026    import org.apache.maven.model.Model;
027    import org.apache.maven.model.DependencyManagement;
028    import org.apache.maven.model.Prerequisites;
029    import org.apache.maven.model.IssueManagement;
030    import org.apache.maven.model.CiManagement;
031    import org.apache.maven.model.DistributionManagement;
032    import org.apache.maven.model.Organization;
033    import org.apache.maven.model.Scm;
034    import org.apache.maven.model.MailingList;
035    import org.apache.maven.model.Developer;
036    import org.apache.maven.model.Contributor;
037    import org.apache.maven.model.Build;
038    import org.apache.maven.model.Resource;
039    import org.apache.maven.model.Reporting;
040    import org.apache.maven.model.License;
041    import org.apache.maven.model.PluginManagement;
042    import org.apache.maven.model.Plugin;
043    import org.codehaus.plexus.util.xml.Xpp3Dom;
044    
045    import java.io.IOException;
046    import java.io.File;
047    import java.io.Writer;
048    import java.util.List;
049    import java.util.Set;
050    import java.util.Map;
051    import java.util.Properties;
052    
053    /**
054     * {@link MavenProject} delegation adapter.
055     *
056     * @version $Id: MavenProjectDelegateAdapter.java 8 2009-07-16 09:15:04Z user57 $
057     * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
058     */
059    public class MavenProjectDelegateAdapter
060        extends MavenProject
061    {
062        private final MavenProject delegate;
063    
064        public MavenProjectDelegateAdapter(final MavenProject project) {
065            assert project != null;
066    
067            this.delegate = project;
068        }
069    
070        public MavenProject getDelegate() {
071            return delegate;
072        }
073    
074        public String getModulePathAdjustment(final MavenProject project) throws IOException {
075            return getDelegate().getModulePathAdjustment(project);
076        }
077    
078        public Artifact getArtifact() {
079            return getDelegate().getArtifact();
080        }
081    
082        public void setArtifact(final Artifact artifact) {
083            getDelegate().setArtifact(artifact);
084        }
085    
086        public Model getModel() {
087            return getDelegate().getModel();
088        }
089    
090        public MavenProject getParent() {
091            return getDelegate().getParent();
092        }
093    
094        public void setParent(final MavenProject project) {
095            getDelegate().setParent(project);
096        }
097    
098        public void setRemoteArtifactRepositories(final List list) {
099            getDelegate().setRemoteArtifactRepositories(list);
100        }
101    
102        public List getRemoteArtifactRepositories() {
103            return getDelegate().getRemoteArtifactRepositories();
104        }
105    
106        public boolean hasParent() {
107            return getDelegate().hasParent();
108        }
109    
110        public File getFile() {
111            return getDelegate().getFile();
112        }
113    
114        public void setFile(File file) {
115            getDelegate().setFile(file);
116        }
117    
118        public File getBasedir() {
119            return getDelegate().getBasedir();
120        }
121    
122        public void setDependencies(List list) {
123            getDelegate().setDependencies(list);
124        }
125    
126        public List getDependencies() {
127            return getDelegate().getDependencies();
128        }
129    
130        public DependencyManagement getDependencyManagement() {
131            return getDelegate().getDependencyManagement();
132        }
133    
134        public void addCompileSourceRoot(final String root) {
135            getDelegate().addCompileSourceRoot(root);
136        }
137    
138        public void addScriptSourceRoot(final String root) {
139            getDelegate().addScriptSourceRoot(root);
140        }
141    
142        public void addTestCompileSourceRoot(final String root) {
143            getDelegate().addTestCompileSourceRoot(root);
144        }
145    
146        public List getCompileSourceRoots() {
147            return getDelegate().getCompileSourceRoots();
148        }
149    
150        public List getScriptSourceRoots() {
151            return getDelegate().getScriptSourceRoots();
152        }
153    
154        public List getTestCompileSourceRoots() {
155            return getDelegate().getTestCompileSourceRoots();
156        }
157    
158        public List getCompileClasspathElements() throws DependencyResolutionRequiredException {
159            return getDelegate().getCompileClasspathElements();
160        }
161    
162        public List getCompileArtifacts() {
163            return getDelegate().getCompileArtifacts();
164        }
165    
166        public List getCompileDependencies() {
167            return getDelegate().getCompileDependencies();
168        }
169    
170        public List getTestClasspathElements() throws DependencyResolutionRequiredException {
171            return getDelegate().getTestClasspathElements();
172        }
173    
174        public List getTestArtifacts() {
175            return getDelegate().getTestArtifacts();
176        }
177    
178        public List getTestDependencies() {
179            return getDelegate().getTestDependencies();
180        }
181    
182        public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException {
183            return getDelegate().getRuntimeClasspathElements();
184        }
185    
186        public List getRuntimeArtifacts() {
187            return getDelegate().getRuntimeArtifacts();
188        }
189    
190        public List getRuntimeDependencies() {
191            return getDelegate().getRuntimeDependencies();
192        }
193    
194        public List getSystemClasspathElements() throws DependencyResolutionRequiredException {
195            return getDelegate().getSystemClasspathElements();
196        }
197    
198        public List getSystemArtifacts() {
199            return getDelegate().getSystemArtifacts();
200        }
201    
202        public List getSystemDependencies() {
203            return getDelegate().getSystemDependencies();
204        }
205    
206        public void setModelVersion(final String version) {
207            getDelegate().setModelVersion(version);
208        }
209    
210        public String getModelVersion() {
211            return getDelegate().getModelVersion();
212        }
213    
214        public String getId() {
215            return getDelegate().getId();
216        }
217    
218        public void setGroupId(final String id) {
219            getDelegate().setGroupId(id);
220        }
221    
222        public String getGroupId() {
223            return getDelegate().getGroupId();
224        }
225    
226        public void setArtifactId(final String id) {
227            getDelegate().setArtifactId(id);
228        }
229    
230        public String getArtifactId() {
231            return getDelegate().getArtifactId();
232        }
233    
234        public void setName(final String name) {
235            getDelegate().setName(name);
236        }
237    
238        public String getName() {
239            return getDelegate().getName();
240        }
241    
242        public void setVersion(final String version) {
243            getDelegate().setVersion(version);
244        }
245    
246        public String getVersion() {
247            return getDelegate().getVersion();
248        }
249    
250        public String getPackaging() {
251            return getDelegate().getPackaging();
252        }
253    
254        public void setPackaging(final String s) {
255            getDelegate().setPackaging(s);
256        }
257    
258        public void setInceptionYear(final String s) {
259            getDelegate().setInceptionYear(s);
260        }
261    
262        public String getInceptionYear() {
263            return getDelegate().getInceptionYear();
264        }
265    
266        public void setUrl(final String url) {
267            getDelegate().setUrl(url);
268        }
269    
270        public String getUrl() {
271            return getDelegate().getUrl();
272        }
273    
274        public Prerequisites getPrerequisites() {
275            return getDelegate().getPrerequisites();
276        }
277    
278        public void setIssueManagement(final IssueManagement management) {
279            getDelegate().setIssueManagement(management);
280        }
281    
282        public CiManagement getCiManagement() {
283            return getDelegate().getCiManagement();
284        }
285    
286        public void setCiManagement(final CiManagement management) {
287            getDelegate().setCiManagement(management);
288        }
289    
290        public IssueManagement getIssueManagement() {
291            return getDelegate().getIssueManagement();
292        }
293    
294        public void setDistributionManagement(final DistributionManagement management) {
295            getDelegate().setDistributionManagement(management);
296        }
297    
298        public DistributionManagement getDistributionManagement() {
299            return getDelegate().getDistributionManagement();
300        }
301    
302        public void setDescription(final String s) {
303            getDelegate().setDescription(s);
304        }
305    
306        public String getDescription() {
307            return getDelegate().getDescription();
308        }
309    
310        public void setOrganization(final Organization organization) {
311            getDelegate().setOrganization(organization);
312        }
313    
314        public Organization getOrganization() {
315            return getDelegate().getOrganization();
316        }
317    
318        public void setScm(final Scm scm) {
319            getDelegate().setScm(scm);
320        }
321    
322        public Scm getScm() {
323            return getDelegate().getScm();
324        }
325    
326        public void setMailingLists(final List list) {
327            getDelegate().setMailingLists(list);
328        }
329    
330        public List getMailingLists() {
331            return getDelegate().getMailingLists();
332        }
333    
334        public void addMailingList(final MailingList mailingList) {
335            getDelegate().addMailingList(mailingList);
336        }
337    
338        public void setDevelopers(final List list) {
339            getDelegate().setDevelopers(list);
340        }
341    
342        public List getDevelopers() {
343            return getDelegate().getDevelopers();
344        }
345    
346        public void addDeveloper(final Developer developer) {
347            getDelegate().addDeveloper(developer);
348        }
349    
350        public void setContributors(final List list) {
351            getDelegate().setContributors(list);
352        }
353    
354        public List getContributors() {
355            return getDelegate().getContributors();
356        }
357    
358        public void addContributor(final Contributor contributor) {
359            getDelegate().addContributor(contributor);
360        }
361    
362        public void setBuild(final Build build) {
363            getDelegate().setBuild(build);
364        }
365    
366        public Build getBuild() {
367            return getDelegate().getBuild();
368        }
369    
370        public List getResources() {
371            return getDelegate().getResources();
372        }
373    
374        public List getTestResources() {
375            return getDelegate().getTestResources();
376        }
377    
378        public void addResource(final Resource resource) {
379            getDelegate().addResource(resource);
380        }
381    
382        public void addTestResource(final Resource resource) {
383            getDelegate().addTestResource(resource);
384        }
385    
386        public void setReporting(final Reporting reporting) {
387            getDelegate().setReporting(reporting);
388        }
389    
390        public Reporting getReporting() {
391            return getDelegate().getReporting();
392        }
393    
394        public void setLicenses(final List list) {
395            getDelegate().setLicenses(list);
396        }
397    
398        public List getLicenses() {
399            return getDelegate().getLicenses();
400        }
401    
402        public void addLicense(final License license) {
403            getDelegate().addLicense(license);
404        }
405    
406        public void setArtifacts(final Set set) {
407            getDelegate().setArtifacts(set);
408        }
409    
410        public Set getArtifacts() {
411            return getDelegate().getArtifacts();
412        }
413    
414        public Map getArtifactMap() {
415            return getDelegate().getArtifactMap();
416        }
417    
418        public void setPluginArtifacts(final Set set) {
419            getDelegate().setPluginArtifacts(set);
420        }
421    
422        public Set getPluginArtifacts() {
423            return getDelegate().getPluginArtifacts();
424        }
425    
426        public Map getPluginArtifactMap() {
427            return getDelegate().getPluginArtifactMap();
428        }
429    
430        public void setReportArtifacts(final Set set) {
431            getDelegate().setReportArtifacts(set);
432        }
433    
434        public Set getReportArtifacts() {
435            return getDelegate().getReportArtifacts();
436        }
437    
438        public Map getReportArtifactMap() {
439            return getDelegate().getReportArtifactMap();
440        }
441    
442        public void setExtensionArtifacts(final Set set) {
443            getDelegate().setExtensionArtifacts(set);
444        }
445    
446        public Set getExtensionArtifacts() {
447            return getDelegate().getExtensionArtifacts();
448        }
449    
450        public Map getExtensionArtifactMap() {
451            return getDelegate().getExtensionArtifactMap();
452        }
453    
454        public void setParentArtifact(final Artifact artifact) {
455            getDelegate().setParentArtifact(artifact);
456        }
457    
458        public Artifact getParentArtifact() {
459            return getDelegate().getParentArtifact();
460        }
461    
462        public List getRepositories() {
463            return getDelegate().getRepositories();
464        }
465    
466        public List getReportPlugins() {
467            return getDelegate().getReportPlugins();
468        }
469    
470        public List getBuildPlugins() {
471            return getDelegate().getBuildPlugins();
472        }
473    
474        public List getModules() {
475            return getDelegate().getModules();
476        }
477    
478        public PluginManagement getPluginManagement() {
479            return getDelegate().getPluginManagement();
480        }
481    
482        public void addPlugin(final Plugin plugin) {
483            getDelegate().addPlugin(plugin);
484        }
485    
486        public void injectPluginManagementInfo(final Plugin plugin) {
487            getDelegate().injectPluginManagementInfo(plugin);
488        }
489    
490        public List getCollectedProjects() {
491            return getDelegate().getCollectedProjects();
492        }
493    
494        public void setCollectedProjects(final List list) {
495            getDelegate().setCollectedProjects(list);
496        }
497    
498        public void setPluginArtifactRepositories(final List list) {
499            getDelegate().setPluginArtifactRepositories(list);
500        }
501    
502        public List getPluginArtifactRepositories() {
503            return getDelegate().getPluginArtifactRepositories();
504        }
505    
506        public ArtifactRepository getDistributionManagementArtifactRepository() {
507            return getDelegate().getDistributionManagementArtifactRepository();
508        }
509    
510        public List getPluginRepositories() {
511            return getDelegate().getPluginRepositories();
512        }
513    
514        public void setActiveProfiles(final List list) {
515            getDelegate().setActiveProfiles(list);
516        }
517    
518        public List getActiveProfiles() {
519            return getDelegate().getActiveProfiles();
520        }
521    
522        public void addAttachedArtifact(final Artifact artifact) {
523            getDelegate().addAttachedArtifact(artifact);
524        }
525    
526        public List getAttachedArtifacts() {
527            return getDelegate().getAttachedArtifacts();
528        }
529    
530        public Xpp3Dom getGoalConfiguration(final String s, final String s1, final String s2, final String s3) {
531            return getDelegate().getGoalConfiguration(s, s1, s2, s3);
532        }
533    
534        public Xpp3Dom getReportConfiguration(final String s, final String s1, final String s2) {
535            return getDelegate().getReportConfiguration(s, s1, s2);
536        }
537    
538        public MavenProject getExecutionProject() {
539            return getDelegate().getExecutionProject();
540        }
541    
542        public void setExecutionProject(final MavenProject project) {
543            getDelegate().setExecutionProject(project);
544        }
545    
546        public void writeModel(final Writer writer) throws IOException {
547            getDelegate().writeModel(writer);
548        }
549    
550        public void writeOriginalModel(final Writer writer) throws IOException {
551            getDelegate().writeOriginalModel(writer);
552        }
553    
554        public Set getDependencyArtifacts() {
555            return getDelegate().getDependencyArtifacts();
556        }
557    
558        public void setDependencyArtifacts(final Set set) {
559            getDelegate().setDependencyArtifacts(set);
560        }
561    
562        public void setReleaseArtifactRepository(final ArtifactRepository repository) {
563            getDelegate().setReleaseArtifactRepository(repository);
564        }
565    
566        public void setSnapshotArtifactRepository(final ArtifactRepository repository) {
567            getDelegate().setSnapshotArtifactRepository(repository);
568        }
569    
570        public void setOriginalModel(final Model model) {
571            getDelegate().setOriginalModel(model);
572        }
573    
574        public Model getOriginalModel() {
575            return getDelegate().getOriginalModel();
576        }
577    
578        public List getBuildExtensions() {
579            return getDelegate().getBuildExtensions();
580        }
581    
582        public Set createArtifacts(final ArtifactFactory factory, final String s, final ArtifactFilter filter) throws InvalidDependencyVersionException {
583            return getDelegate().createArtifacts(factory, s, filter);
584        }
585    
586        public void addProjectReference(final MavenProject project) {
587            getDelegate().addProjectReference(project);
588        }
589    
590        /** @noinspection deprecation*/
591        public void attachArtifact(final String s, final String s1, final File file) {
592            getDelegate().attachArtifact(s, s1, file);
593        }
594    
595        public Properties getProperties() {
596            return getDelegate().getProperties();
597        }
598    
599        public List getFilters() {
600            return getDelegate().getFilters();
601        }
602    
603        public Map getProjectReferences() {
604            return getDelegate().getProjectReferences();
605        }
606    
607        public boolean isExecutionRoot() {
608            return getDelegate().isExecutionRoot();
609        }
610    
611        public void setExecutionRoot(final boolean b) {
612            getDelegate().setExecutionRoot(b);
613        }
614    
615        public String getDefaultGoal() {
616            return getDelegate().getDefaultGoal();
617        }
618    
619        public Artifact replaceWithActiveArtifact(final Artifact artifact) {
620            return getDelegate().replaceWithActiveArtifact(artifact);
621        }
622    }