小编num*_*een的帖子

Maven Checkstyle 插件 - 更改 ${project.build.directory} 中文件 checkstyle-checker.xml 的位置

尝试清理我的 时${project.build.directory},我注意到maven-checkstyle-plugin将三个文件放入我的target文件夹中:checkstyle-checker.xmlcheckstyle-cachefilecheckstyle-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-checkerpropertiesLocation下。有说:

如果成功解析,属性位置的内容将被复制到 ${project.build.directory}/checkstyle-checker.properties 文件中,然后传递给 Checkstyle 进行加载。

我可以更改属性位置内容复制到的位置吗?或者是否有另一种方法可以使插件将checkstyle-checker.xml文件写入我的自定义文件夹target/checkstyle

java maven maven-checkstyle-plugin

5
推荐指数
1
解决办法
1234
查看次数

标签 统计

java ×1

maven ×1

maven-checkstyle-plugin ×1