如何下载用于Maven PMD插件的PMD_RUULESET文件?
我正在尝试在我的代码库中添加Maven PMD插件。在POM文件中添加了以下代码,但不确定在哪里下载PMD_RULESET.xml文件。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.17.0</version>
<configuration>
<rulesets>
<ruleset>../pmd_ruleset.xml</ruleset>
</rulesets>
<targetJdk>11</targetJdk>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
</execution>
</executions>
</plugin>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
maven-pmd-plugin 的最新版本是 href =“ https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-pmd-plugin/3.17.0” rel =“ nofollow noreferrer”> 3.17.0 。默认情况下,它将使用PMD 6.46.0。
使用Maven-PMD-Plugin时,您无需提供自己的规则集。如
如果您运行
MVN CLEAN验证
,则可以在Maven构建目录中查看规则集(对我来说,它是target/pmd/presutets/maven-pmd-pmd-plugin-default.xml
)。您还可以查看在线。如果您想使用自己的规则集,则可以关注PMD的
也可以在线下载一些规则集。例如,您可以在 github 。
maven-pmd-plugin's latest version is 3.17.0. By default, it will use PMD 6.46.0.
When using maven-pmd-plugin, you don't need to provide your own ruleset. As mentioned in Using Rule Sets:
If you run
mvn clean verify
, you can see the ruleset in your maven build directory (for me it'starget/pmd/rulesets/maven-pmd-plugin-default.xml
). You can also view it online.If you'd like to use your own ruleset, you can follow PMD's Making rulesets document and try to make your own ruleset.
It's also possible to download some rulesets online. E.g., you can search PMD rulesets on GitHub.
插件包含默认规则集文件,因此您可能首先不需要自定义规则集。但是,如果这样做,则有一些选项:
The default ruleset file is included with the plugin, so it's possible you don't need the custom ruleset in the first place. However, if you do, there are some options: