[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (verify) on project rocketmq-client: Failed during checkstyle execution: There are 38 errors reported by Checkstyle 6.11.2 with style/rmq_checkstyle.xml ruleset. -> [Help 1]
项目依赖了 maven-checkstyle-plugin
插件,编译打包时会根据对应配置文件检查。很多时候从网络下载的开源项目,我们只关注能否编译过,可以将此插件去掉或者关闭,这里采用关闭的方式来解决。
maven编译的时候增加参数checkstyle.skip=true
加参数记得用D:
clean install -Dcheckstyle.skip=true
扩展
用skipTests=true
可以跳过执行单元测试
clean install -DskipTests=true -Dcheckstyle.skip=true
在configuration标签下,增加skip标签,跳过检查
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<id>verify</id>
<phase>verify</phase>
<configuration>
<skip>true</skip>
<configLocation>style/rmq_checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
再clean install
,就可以了。