protected List getErrorDetails()

in src/main/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojo.java [115:130]


    protected List<Violation> getErrorDetails(File pmdFile) throws XmlPullParserException, IOException {
        try (InputStream in = new FileInputStream(pmdFile)) {
            PmdXpp3Reader reader = new PmdXpp3Reader();
            PmdErrorDetail details = reader.read(in, false);
            List<Violation> violations = new ArrayList<>();
            for (PmdFile file : details.getFiles()) {
                String fullPath = file.getName();

                for (Violation violation : file.getViolations()) {
                    violation.setFileName(getFilename(fullPath, violation.getViolationPackage()));
                    violations.add(violation);
                }
            }
            return violations;
        }
    }