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