我面临以下问题。我已经使用以下配置设置了我的 checkstyle:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<inherited/>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
当我运行 mvn site
时运行正常.但是,当我通过 mvn checkstyle:checkstyle
运行 checkstyle 时为了更有效地获取 XML 报告,checkstyle 插件故障回复使用默认配置。当我将插件移动到 <build>
时XML 已正确生成,但现在生成的站点中不再包含 checkstyle 报告。
将报告插件设置为 Checkstyle 的(当前)方法是什么,同时保留在相同配置下单独运行插件的能力?
它真的是定义插件和配置两次的首选方式吗?
最佳答案
好吧,显然你应该将带有配置的插件添加到 <build>
和 <reporting>
.
关于java - mvn checkstyle :checkstyle uses wrong configuration when using reporting,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30467166/