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
38 public class MavenReportExecutorRequest
39 {
40 private ArtifactRepository localRepository;
41
42 private MavenSession mavenSession;
43
44 private MavenProject project;
45
46 private ReportPlugin[] reportPlugins;
47
48 public ArtifactRepository getLocalRepository()
49 {
50 return localRepository;
51 }
52
53 public void setLocalRepository( ArtifactRepository localRepository )
54 {
55 this.localRepository = localRepository;
56 }
57
58 public MavenSession getMavenSession()
59 {
60 return mavenSession;
61 }
62
63 public void setMavenSession( MavenSession mavenSession )
64 {
65 this.mavenSession = mavenSession;
66 }
67
68 public MavenProject getProject()
69 {
70 return project;
71 }
72
73 public void setProject( MavenProject project )
74 {
75 this.project = project;
76 }
77
78 public ReportPlugin[] getReportPlugins()
79 {
80 return reportPlugins;
81 }
82
83 public void setReportPlugins( ReportPlugin[] reportPlugins )
84 {
85 this.reportPlugins = reportPlugins;
86 }
87
88
89
90
91
92
93
94 public void setReportPlugins( org.apache.maven.model.ReportPlugin[] reportPlugins )
95 {
96 setReportPlugins( new ReportPlugin[reportPlugins.length] );
97
98 int i = 0;
99 for ( org.apache.maven.model.ReportPlugin r : reportPlugins )
100 {
101 ReportPlugin p = new ReportPlugin();
102 p.setGroupId( r.getGroupId() );
103 p.setArtifactId( r.getArtifactId() );
104 p.setVersion( r.getVersion() );
105 if ( r.getConfiguration() != null )
106 {
107 p.setConfiguration( new XmlPlexusConfiguration( (Xpp3Dom) r.getConfiguration() ) );
108 }
109
110 List<ReportSet> prs = new ArrayList<>();
111 for ( org.apache.maven.model.ReportSet rs : r.getReportSets() )
112 {
113 ReportSet ps = new ReportSet();
114 ps.setId( rs.getId() );
115 ps.setReports( rs.getReports() );
116 if ( rs.getConfiguration() != null )
117 {
118 ps.setConfiguration( new XmlPlexusConfiguration( (Xpp3Dom) rs.getConfiguration() ) );
119 }
120 prs.add( ps );
121 }
122 p.setReportSets( prs );
123
124 this.reportPlugins[i++] = p;
125 }
126 }
127 }