該規則集與文件all-java.xml
中的PMD一起分發。
下面是它的內容:
<?xml version="1.0"?>
<ruleset name="All Java Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Every Java Rule in PMD</description>
<rule ref="rulesets/java/android.xml"/>
<rule ref="rulesets/java/basic.xml"/>
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/clone.xml"/>
<rule ref="rulesets/java/codesize.xml"/>
<rule ref="rulesets/java/comments.xml"/>
<rule ref="rulesets/java/controversial.xml"/>
<rule ref="rulesets/java/coupling.xml"/>
<rule ref="rulesets/java/design.xml"/>
<rule ref="rulesets/java/empty.xml"/>
<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/imports.xml"/>
<rule ref="rulesets/java/j2ee.xml"/>
<rule ref="rulesets/java/javabeans.xml"/>
<rule ref="rulesets/java/junit.xml"/>
<rule ref="rulesets/java/logging-jakarta-commons.xml"/>
<rule ref="rulesets/java/logging-java.xml"/>
<rule ref="rulesets/java/migrating.xml"/>
<rule ref="rulesets/java/naming.xml"/>
<rule ref="rulesets/java/optimizations.xml"/>
<rule ref="rulesets/java/strictexception.xml"/>
<rule ref="rulesets/java/strings.xml"/>
<rule ref="rulesets/java/sunsecure.xml"/>
<rule ref="rulesets/java/typeresolution.xml"/>
<rule ref="rulesets/java/unnecessary.xml"/>
<rule ref="rulesets/java/unusedcode.xml"/>
</ruleset>
解決方案:從http://sourceforge.net/projects/pmd/files/pmd/5.3.3/下載最新版本,並看看PMD-java的5.3 .3.jar。您將在rulesets-folder中找到* .xml文件 –