1 package org.apache.maven.reporting.exec;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.ArrayList;
23 import java.util.List;
24
25 import org.apache.maven.artifact.repository.ArtifactRepository;
26 import org.apache.maven.execution.MavenSession;
27 import org.apache.maven.project.MavenProject;
28 import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
29 import org.codehaus.plexus.util.xml.Xpp3Dom;
30
31
32
33
34
35
36
37 public class MavenReportExecutorRequest
38 {
39 private ArtifactRepository localRepository;
40
41 private MavenSession mavenSession;
42
43 private MavenProject project;
44
45 private ReportPlugin[] reportPlugins;
46
47 public ArtifactRepository getLocalRepository()
48 {
49 return localRepository;
50 }
51
52 public void setLocalRepository( ArtifactRepository localRepository )
53 {
54 this.localRepository = localRepository;
55 }
56
57 public MavenSession getMavenSession()
58 {
59 return mavenSession;
60 }
61
62 public void setMavenSession( MavenSession mavenSession )
63 {
64 this.mavenSession = mavenSession;
65 }
66
67 public MavenProject getProject()
68 {
69 return project;
70 }
71
72 public void setProject( MavenProject project )
73 {
74 this.project = project;
75 }
76
77 public ReportPlugin[] getReportPlugins()
78 {
79 return reportPlugins;
80 }
81
82 public void setReportPlugins( ReportPlugin[] reportPlugins )
83 {
84 this.reportPlugins = reportPlugins;
85 }
86
87
88
89
90
91
92
93 public void setReportPlugins( org.apache.maven.model.ReportPlugin[] reportPlugins )
94 {
95 setReportPlugins( new ReportPlugin[reportPlugins.length] );
96
97 int i = 0;
98 for ( org.apache.maven.model.ReportPlugin r : reportPlugins )
99 {
100 ReportPlugin p = new ReportPlugin();
101 p.setGroupId( r.getGroupId() );
102 p.setArtifactId( r.getArtifactId() );
103 p.setVersion( r.getVersion() );
104 if ( r.getConfiguration() != null )
105 {
106 p.setConfiguration( new XmlPlexusConfiguration( (Xpp3Dom) r.getConfiguration() ) );
107 }
108
109 List<ReportSet> prs = new ArrayList<>();
110 for ( org.apache.maven.model.ReportSet rs : r.getReportSets() )
111 {
112 ReportSet ps = new ReportSet();
113 ps.setId( rs.getId() );
114 ps.setReports( rs.getReports() );
115 if ( rs.getConfiguration() != null )
116 {
117 ps.setConfiguration( new XmlPlexusConfiguration( (Xpp3Dom) rs.getConfiguration() ) );
118 }
119 prs.add( ps );
120 }
121 p.setReportSets( prs );
122
123 this.reportPlugins[i++] = p;
124 }
125 }
126 }