public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = projectFileSystem.writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new SonarException("Fail to save the PMD configuration", e); } }
public File dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML)) { return null; } try { String reportAsString = reportToString(report); File reportFile = projectFileSystem.writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.getAbsolutePath()); return reportFile; } catch (IOException e) { throw new SonarException("Fail to save the PMD report", e); } }