Skip to content

Commit

Permalink
Update PMD BeanMembersShouldSerialize exclusion (#535)
Browse files Browse the repository at this point in the history
The BeanMembersShouldSerialize rule has been deprecated since PMD version 6.52.0.  It has been replaced with NonSerializableClass (see https://pmd.github.io/pmd/pmd_rules_java_errorprone.html#beanmembersshouldserialize).  Changed exclusion for BeanMembersShouldSerialize in PMD ruleset.xml to NonSerializableClass.

The change will prevent a "Unable to exclude rules [BeanMembersShouldSerialize] from ruleset reference category/java/errorprone.xml; perhaps the rule name is misspelled or the rule doesn't exist anymore?" messages being displayed in the build output.

A number of projects using this template have already made this change (e.g. https://github.com/hmcts/sscs-hearings-api/blob/master/config/pmd/ruleset.xml#L66).

Co-authored-by: Felix Eyetan <peyetan@yahoo.com>
  • Loading branch information
paulridout and madjava authored Nov 3, 2023
1 parent f3f1477 commit dbd12c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<exclude name="UncommentedEmptyMethodBody"/>
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="NonSerializableClass"/>
</rule>
<rule ref="category/java/multithreading.xml"/>
<rule ref="category/java/performance.xml"/>
Expand Down

0 comments on commit dbd12c7

Please sign in to comment.