我正在使用PMD 3.1 maven插件,它似乎无法识别规则> 5.0。
即。我做maven构建时找不到AvoidProtectedMethodInFinalClassNotExtending
。
Failure executing PMD: Unable to find referenced rule AvoidProtectedMethodInFinalClassNotExtending; perhaps the rule name is mispelled?
我已将目标JDK设置为使用1.7
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.1</version>
<dependencies>
<dependency>
<groupId>au.com.patrick.vts.build.tools</groupId>
<artifactId>build-tools</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<configuration>
<failsOnError>true</failsOnError>
<targetJdk>${java-version}</targetJdk>
<linkXRef>true</linkXRef>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
<execution>
<id>compile</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
答案 0 :(得分:0)
maven-pmd-plugin的当前版本3.1使用PMD 5.0.5并且不支持5.1规则。 release a new version with PMD 5.1的问题跟踪器上有一张开放票。你现在所能做的只是投票,希望很快得到解决或自己解决问题。