use of net.sourceforge.pmd.cpd.Renderer in project maven-plugins by apache.
the class CpdReport method writeNonHtml.
void writeNonHtml(CPD cpd) throws MavenReportException {
Renderer r = createRenderer();
if (r == null) {
return;
}
String buffer = r.render(filterMatches(cpd.getMatches()));
File targetFile = new File(targetDirectory, "cpd." + format);
targetDirectory.mkdirs();
try (Writer writer = new OutputStreamWriter(new FileOutputStream(targetFile), getOutputEncoding())) {
writer.write(buffer);
if (includeXmlInSite) {
File siteDir = getReportOutputDirectory();
siteDir.mkdirs();
FileUtils.copyFile(targetFile, new File(siteDir, "cpd." + format));
}
} catch (IOException ioe) {
throw new MavenReportException(ioe.getMessage(), ioe);
}
}
Aggregations