我已经将我的pom文件配置为使用pom文件中的插件生成pmd报告。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>pmd</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<format>xml</format>
</configuration>
</execution>
</executions>
</plugin>在这里,我可以使用以下方法在我的项目目标文件夹下创建报表pmd.xml:
mvn clean compile" command但是它也在目标文件夹下创建了“站点”文件夹,而pmd.html文件也在该站点文件夹中创建。
why.How到configue,这样站点文件夹就不会创建。
发布于 2017-03-09 11:19:54
您应该看看如何使用这个插件:https://maven.apache.org/plugins/maven-pmd-plugin/examples/removeReport.html删除报告。
创建目标/站点是因为如果您检查pmd:check 目标文件,它会说:
在执行它自己之前调用这个插件的目标pmd的执行。
然后检查pmd:pmd 目标文件,您可以看到输出目录:
最终的输出目录。请注意,只有当目标直接从命令行或在默认生命周期内运行时,才会评估此参数。如果目标作为站点生成的一部分间接运行,则使用Maven站点插件中配置的输出目录。用户属性为:project.reporting.outputDirectory.
而${project.reporting.outputDirectory}是由目标/站点提供的。
编辑:据我所知,您不能生成项目,但是您可以更改创建HTML报告的目录,例如,使用配置部分中的<outputDirectory>:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>pmd</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/myHtmlPmdDirectory</outputDirectory>
<format>xml</format>
</configuration>
</execution>
</executions>
<plugin>https://stackoverflow.com/questions/42693443
复制相似问题