Duplicate warnings in the style of the jenkins maven animator

I have jenkins maven working with a pom aggregator and a bunch of submodules. When jenkins displays checkstyle warnings, he does it like this:

  • submodule 1:10 warnings
  • submodule 2: 10 warnings
  • Aggregator Module: 20 Warnings

  • Total: 40 warnings

In other words, the aggregator (by right?) Combines the warnings found in the submodules, which would not be such a big problem, if not because then the amount then becomes twice as much as it should be.

Does anyone know what the problem is? Thank!

+3
maven jenkins checkstyle
Nov 17 '12 at 13:11
source share
2 answers

It depends on whether you use a project like Freestyle or an Evil Maven project project .

If you are using freestyle, you just need to set the template for the results of checkstyle.xml to exclude aggregator or exclude subprojects.

If you use an evil brother, you may need to configure the per-module configuration to disable reports for child modules.

The problem is that the aggregator module copies warnings from child projects to create an aggregated report.

You can also disable aggregation when the job is running on Jenkins.

This is basically the struggle between auto-impulse β€œmagic” from an evil type of project and how the maven-checkstyle-plugin module implements aggregate reporting.

+2
Nov 17 '12 at 20:52
source share

You can adapt some tricks from here.

Add the following to the pom aggregator:

 <project> ... <profiles> ... <profile> <id>on-jenkins</id> <build> <plugins> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <inherited>false</inherited> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> </profile> ... </profiles> ... </project> 

And add -P+on-jenkins to your Maven goals in Jenkins quest.

0
Nov 18 '12 at 11:16
source share



All Articles