我正在尝试maven-checkstyle-plugin
按照官方文档添加以下内容作为构建检查的一部分。但是我尝试了,我无法让它使用自定义规则运行。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
checkstyle.xml
仅包含在此google_checks.xml中找到的确切内容。
执行后mvn checkstyle:check
,我总是被
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check (default-cli) on project XXXXXXX: Failed during checkstyle configuration: cannot initialize module LineLength - Property 'fileExtensions' does not exist, please check the documentation