in src/main/java/org/apache/maven/plugins/pmd/PmdReport.java [458:480]
protected String getLocationTemp(String name, int position) {
String loc = name;
if (loc.indexOf('/') != -1) {
loc = loc.substring(loc.lastIndexOf('/') + 1);
}
if (loc.indexOf('\\') != -1) {
loc = loc.substring(loc.lastIndexOf('\\') + 1);
}
// MPMD-127 in the case that the rules are defined externally on a URL,
// we need to replace some special URL characters that cannot be
// used in filenames on disk or produce awkward filenames.
// Replace all occurrences of the following characters: ? : & = %
loc = loc.replaceAll("[\\?\\:\\&\\=\\%]", "_");
if (loc.endsWith(".xml")) {
loc = loc.substring(0, loc.length() - 4);
}
loc = String.format("%03d-%s.xml", position, loc);
getLog().debug("Before: " + name + " After: " + loc);
return loc;
}