• maven 3.8.6 执行 mvn clean install 报如下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.8:check (default) on project nacos-config: You have 1 PMD violation. For more details see: D:\nacos\nacos-2.2.3\config\target\pmd.xml -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  • 这个错误信息表明在构建 Maven 项目时,maven-pmd-plugin 插件发现了代码中的静态分析问题(PMD violations)。具体来说,在 nacos-config 项目中有一个 PMD 违规项。

解决方法如下:

1、PMD 工具已经生成了一个报告文件位于 D:\nacos\nacos-2.2.3\config\target\pmd.xml。打开这个 XML 文件以获取关于违规项的详细信息。根据 PMD 报告中指出的具体位置和类型,修改代码以解决这些违规项。PMD 的警告通常包括对潜在错误、性能问题或不符合最佳实践的建议;遵循这些建议有助于提高代码质量。

2、跳过 PMD 检查

mvn clean install -Dpmd.skip=true
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐