找不到 PMD XML 报告

Can't find PMD XML report

我运行一个Maven命令为“mvn sonar:sonarpmd:pmd”,我可以在每个模块的目标文件夹下看到生成的pmd.xml文件。但是在命令输出中我可以看到

[INFO] Sensor Import of PMD issues [java]

[INFO] Importing D:\Temp\workshop1\mat\mat-publish\mat-publish-core\target\pmd.xml

[ERROR] Can't find PMD XML report: D:\Temp\workshop1\mat\mat-publish\mat-publish-core\target\pmd.xml

[INFO] Sensor Import of PMD issues [java] (done) | time=16ms

可以直接用路径打开pmd.xml,不知道为什么报找不到文件

您以错误的顺序执行目标:

mvn sonar:sonar pmd:pmd

首先执行 SonarScanner,然后执行 PMD。这意味着 PMD 报告在 SonarScanner 执行其工作时不可用。您必须更改顺序:

mvn pmd:pmd sonar:sonar