I am using PMD Plugin for Sonar on Jenkins for the static analysis of my code. I am also running the PMD Plugin for Eclipse (eclipse-pmd 1.5 to be exact ( http://marketplace.eclipse.org/content/eclipse-pmd )).
My problem is the following : I wanto to suppress a certain PMD warning. Lets say that I want to suppress the warning ShortClassName (http://pmd.sourceforge.net/pmd-5.1.1/rules/java/naming.html) on my class named Rule. Look at the following example :
@SuppressWarnings("pmd:ShortClassName")
public class Role {
//The class fields, constructors, methods ...
}
That works fine to suppress the warning on Sonar. However, it does not suppress the warning on eclipse-pmd. To do a such thing, I must do the following :
@SuppressWarnings({ "pmd:ShortClassName" , "PMD.ShortClassName" })
public class Role {
//The class fields, constructors, methods ...
}
That works, of course, but it bloats the code. Basically, to be consistent with my two plugins, I have to write (almost) the same suppress warning twice.
So my question is the following : is there a way to change the warning name prefix from eclipse-pmd plugin from PMD. to pmd: , so the same @SuppressWarnings will suppress both warnings from Sonar and eclipse-pmd ?