Suppressing violations in pmd
问题 When I run a PMD analysis I receive violation: Each class should declare at least one constructor This violation is on a Spring controller. This controller is instantiated by Spring, so I shouldn't need to invoke this class. What is recommended way of ignoring this violation? According to http://pmd.sourceforge.net/pmd-4.3/suppressing.html can use //NOPMD but I just want to ignore specific violation. 回答1: PMD also supports the @SuppressWarnings annotations: // This will suppress all the PMD