title: Checkstyle and PMD as advice only
body: <p>How would i set up using pmd and checkstyle results as advice only and disable them on the build server? And would it be bad practice to do so?</p>
  
  <p>Both pmd and checkstyle offer <a href="https://stackoverflow.com/a/184647/1085370">valuable advice</a>, and i want to keep on using them. </p>
  
  <p>But (here comes the but) i find that my code collects a lot of lint trying to work around some of the warnings. To name a few examples:</p>
  
  <ul>
  <li><p>Test-classes contain many mockito and junit static imports, invariably i have to add @SuppressWarnings("PMD.TooManyStaticImports").</p></li>
  <li><p>A class under test needs its fields filled with mock objects, these are not used anywhere in the test but they need to be declared and annotated with @Mock for the class under test to work correctly. Add @SuppressWarnings("PMD.UnusedPrivateField"). </p></li>
  <li><p>In test classes i will have methods for creating objects from a long list of parameters, eg: createPerson(String firstname, String lastname, int shoesize, String favouritecolor, ...). These objects are normally created from a database or XML. Add @SuppressWarnings("PMD.ParameterNumberCheck").</p></li>
  <li><p>Sometimes my documentation will be: "This method makes sure that X in the following 3 cases: \n ...". Apparently this is not allowed as the first sentence should end with a period.</p></li>
  <li><p>Parent class X has some field y that all its children need and use, but checkstyle <a href="https://stackoverflow.com/a/12004551/1085370">won't allow it</a> unless the field is accessed through a method (getY()). This is just unnatural, IMO. </p></li>
  </ul>
  
  <p>One option would be to turn the checks causing the most nuisance off permanently, however a check may be a nuisance or very useful depending on the context. 
  I recognize that explicitly suppressing warnings in the code is also a way to document that only in the specific context, the check is irrelavant and annoying. It is the amount of suppresions that annoys me, almost every testclass needs suppressions, and some of the other classes need workarounds.</p>
  
  <p>So would it be a solutions to generate the warings, but not allow checkstyle and pmd violations to fail te build?</p>