num*_*een 5 java maven maven-checkstyle-plugin
尝试清理我的 时${project.build.directory},我注意到maven-checkstyle-plugin将三个文件放入我的target文件夹中:checkstyle-checker.xml、checkstyle-cachefile和checkstyle-result.xml。
我能够将最后两个重定向到他们自己的文件夹中target/checkstyle:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<cacheFile default-value="${project.build.directory}/checkstyle/checkstyle-cachefile"/>
<configLocation>google_checks.xml</configLocation>
[...]
<outputFile default-value="${project.build.directory}/checkstyle/checkstyle-result.xml">${checkstyle.output.file}</outputFile>
</configuration>
[...]
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我能找到的所有内容都checkstyle-checker在propertiesLocation下。有说:
如果成功解析,属性位置的内容将被复制到 ${project.build.directory}/checkstyle-checker.properties 文件中,然后传递给 Checkstyle 进行加载。
我可以更改属性位置内容复制到的位置吗?或者是否有另一种方法可以使插件将checkstyle-checker.xml文件写入我的自定义文件夹target/checkstyle?
${project.build.directory}/checkstyle-checker.properties您无法在不修改/覆盖插件的情况下更改位置。
关于这一点,文档听起来很清楚。
查看源代码就会发现,这checkstyle-checker.properties是硬编码的。...并且路径 ( ${project.build.directory}) 位于 maven/plexus 的“深处”。
同样适用于(的位置)checkstyle-checker.xml:DefaultCheckstyleExecutor.java#L723
| 归档时间: |
|
| 查看次数: |
1234 次 |
| 最近记录: |