【发布时间】:2018-04-07 21:27:35
【问题描述】:
我在 Intellij 中使用 google checkstyle:https://github.com/google/styleguide
当我在 IntelliJ 中进行任何编码期间进行格式化时,我运行了这个 eclipse checkstyle,它似乎工作正常。我想要一个 Maven 阶段,每当我运行 mvn clean install 时格式化代码。
我正在使用以下插件:
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<configuration>
<configFile>src/main/resources/eclipse-java-google-style.xml</configFile>
<encoding>UTF-8</encoding>
</configuration>
</execution>
</executions>
</plugin>
不幸的是,它似乎没有正确注册该配置文件。我想知道获取正确的 checkstyle 配置的最佳经验法则是什么。我应该把它放在哪里以及如何在我的 POM 中表示它?
【问题讨论】:
标签: java maven checkstyle