Details
Description
PMD's "Avoid Duplicate Literals" has a boolean configuration option, skipAnnotations, to prevent literals like "unchecked" in the annotation @SuppressWarnings("unchecked") to be counted as duplicates.
The default value is false. I set it to true, but alas, literals in annotations are still counted as violations, and so it seems this configuration item is ignored by PMD.
I can't manage to reproduce this error on my side. When I set the property "skipAnnotations" to "true" through the Sonar web interface and relaunch a quality analysis, "Avoid Duplicate Literals" violations are no more reported by Sonar on annotations. Moreover, the pmd.xml file generated by Sonar in the target/sonar/ directory contains the following lines :
Looks like you didn't relaunch a quality analysis ?