Jenkins Maven多模块作业中重复的Checkstyle警告 [英] Duplicate checkstyle warnings in a jenkins maven multimodule job

查看:145
本文介绍了Jenkins Maven多模块作业中重复的Checkstyle警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jenkins maven作业,其中包含一个聚合器pom和一堆子模块.当詹金斯显示checkstyle警告时,它会像这样:

I have a jenkins maven job with an aggregator pom and a bunch of submodules. When jenkins displays the checkstyle warnings it does it like so:

  • 子模块1:10条警告
  • 子模块2:10条警告
  • 聚合器模块:20条警告

  • submodule 1: 10 warnings
  • submodule 2: 10 warnings
  • Aggregator module: 20 warnings

总计:40个警告

换句话说,聚合器(正确地?)聚合了子模块中发现的警告,如果不是因为 total 然后变为原来的两倍,这将不是一个大问题.应该是.

In other words, the aggregator (rightfully?) aggregates the warnings found in the submodules, which wouldn't be such a big problem if it weren't because the total then becomes double what it should be.

有人知道是什么问题吗?谢谢!

Does any one know what the problem is? Thanks!

推荐答案

这取决于您使用的是Freestyle项目类型还是

This depends on whether you are using the Freestyle project type or the Evil Maven Project type.

如果您使用的是自由样式,则只需为checkstyle.xml结果设置模式以排除聚合器或子项目.

If you are using freestyle, you just need to set your pattern for checkstyle.xml results to exclude the aggregator or exclude the sub-projects.

如果您使用的是邪恶同级,则可能需要调整每模块"配置以禁用子模块的报告.

If you are using the evil sibling, you may need to tweak the 'per-module' config to disable the reports for the child modules.

这里的问题是,聚合器模块正在从子项目中复制警告,以生成汇总报告.

The issue here is that the aggregator module is copying the warnings from the child projects in order to produce an aggregated report.

当作业在Jenkins上运行时,您还可以禁用聚合.

You could also disable the aggregation when the job runs on Jenkins.

这基本上是在邪恶项目类型的自动嗅探魔术"与maven-checkstyle-plugin实现汇总报告的方式之间的斗争.

It's basically a fight between the auto-sniffing "magic" from the evil project type and the way the maven-checkstyle-plugin implements the aggregate reporting.

这篇关于Jenkins Maven多模块作业中重复的Checkstyle警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆