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