【发布时间】:2020-12-30 07:33:06
【问题描述】:
我目前正在尝试创建一个基于 Google 样式表的 checkstyle 样式表,但有一些小的调整(新的行长和缩进长度。我从 Github (https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml) 中获取了这个文件,但我是运行时出现以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:check (default-cli) on project some-api: Execution default-cli of goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:check failed: given name COMPACT_CTOR_DEF -> [Help 1]
Maven 插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<consoleOutput>true</consoleOutput>
<configLocation>google_checks1.xml</configLocation>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
我需要包含一些依赖项吗?有没有更好的方法来实现我的目标?任何反馈将不胜感激。
【问题讨论】:
-
你遇到了和stackoverflow.com/questions/63354491/…一样的问题尝试升级checkstyle版本到8.36或者8.36.1
标签: java maven checkstyle maven-checkstyle-plugin