use of org.apache.maven.reporting.exec.MavenReportExecutorRequest in project maven-plugins by apache.
the class AbstractSiteRenderingMojo method getReports.
protected List<MavenReportExecution> getReports() throws MojoExecutionException {
List<MavenReportExecution> allReports;
if (isMaven3OrMore()) {
// Maven 3
MavenReportExecutorRequest mavenReportExecutorRequest = new MavenReportExecutorRequest();
mavenReportExecutorRequest.setLocalRepository(localRepository);
mavenReportExecutorRequest.setMavenSession(mavenSession);
mavenReportExecutorRequest.setProject(project);
mavenReportExecutorRequest.setReportPlugins(reportingPlugins);
MavenReportExecutor mavenReportExecutor;
try {
mavenReportExecutor = (MavenReportExecutor) container.lookup(MavenReportExecutor.class.getName());
} catch (ComponentLookupException e) {
throw new MojoExecutionException("could not get MavenReportExecutor component", e);
}
allReports = mavenReportExecutor.buildMavenReports(mavenReportExecutorRequest);
} else {
// Maven 2
allReports = new ArrayList<MavenReportExecution>(reports.size());
for (MavenReport report : reports) {
allReports.add(new MavenReportExecution(report));
}
}
// filter out reports that can't be generated
List<MavenReportExecution> reportExecutions = new ArrayList<MavenReportExecution>(allReports.size());
for (MavenReportExecution exec : allReports) {
if (exec.canGenerateReport()) {
reportExecutions.add(exec);
}
}
return reportExecutions;
}
use of org.apache.maven.reporting.exec.MavenReportExecutorRequest in project maven-plugins by apache.
the class PdfMojo method getReports.
protected List<MavenReportExecution> getReports() throws MojoExecutionException {
if (isMaven3OrMore()) {
MavenReportExecutorRequest mavenReportExecutorRequest = new MavenReportExecutorRequest();
mavenReportExecutorRequest.setLocalRepository(localRepository);
mavenReportExecutorRequest.setMavenSession(session);
mavenReportExecutorRequest.setProject(project);
mavenReportExecutorRequest.setReportPlugins(reportPlugins);
MavenReportExecutor mavenReportExecutor;
try {
mavenReportExecutor = (MavenReportExecutor) container.lookup(MavenReportExecutor.class.getName());
} catch (ComponentLookupException e) {
throw new MojoExecutionException("could not get MavenReportExecutor component", e);
}
return mavenReportExecutor.buildMavenReports(mavenReportExecutorRequest);
}
List<MavenReportExecution> reportExecutions = new ArrayList<MavenReportExecution>(reports.length);
for (MavenReport report : reports) {
if (report.canGenerateReport()) {
reportExecutions.add(new MavenReportExecution(report));
}
}
return reportExecutions;
}
Aggregations