List<String> outputReportList = new LinkedList<String>();
if (!outputReports.trim().isEmpty()) {
for (String report : outputReports.trim().split(",")) {
outputReportList.add(report);
getLog().info("Writing " + report + " report");
ReportWriter reportWriter = getContext().getBean(report + "ResultWriter", ReportWriter.class);
final File outputFile = getOutputFileForReport(report);
getLog().debug("Writing to " + outputFile.getPath());
try {
reportWriter.writeResults(getProject(), resultCollector.getViolations(), outputFile);
} catch (IOException e) {
throw new MojoExecutionException("Error while writing " + report + " report", e);
}
}
}