maven-checkstyle-plugin error

1. 错误信息

[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]

2. 原因

项目依赖了 maven-checkstyle-plugin插件,编译打包时会根据对应配置文件检查。很多时候从网络下载的开源项目,我们只关注能否编译过,可以将此插件去掉或者关闭,这里采用关闭的方式来解决。

3. 解决办法

3.1 方法一

maven编译的时候增加参数checkstyle.skip=true

加参数记得用D:

clean install -Dcheckstyle.skip=true

扩展
skipTests=true可以跳过执行单元测试
clean install -DskipTests=true -Dcheckstyle.skip=true

3.2 方法二

在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,就可以了。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值