Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46985

CheckStyle-Plugin doubles violations in maven multi module projects

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • checkstyle-plugin
    • Jenkins ver. 2.19.3, checkstyle-plugin: 3.47

    Description

      Scenario: Jenkins maven job ("maven project") for multi module project

      Error: In a maven multi-module projekt the checkstyle plugin summarizes all violations of the modules and adds this value to the parent module, resulting in double amount of violations and duplicate violation messages.

      Expectation: Expectation is that no report is made for the parent as it has no soures and therefor no violations, like the EAR-module for which are no violations are shown in the overview.

      Other:

      This does not happen in findbugs or pmd plugin (only screenshot of findbugs is added)

      Structure if the project is default multi module:

      parent (only pom)
      |- EJB-module
      |- WS-module
      |- WAR-module

      Attachments

        1. checkstyle-logs.txt
          5 kB
        2. doppeltemeldung.png
          doppeltemeldung.png
          26 kB
        3. findbugs.png
          findbugs.png
          20 kB
        4. overview.png
          overview.png
          6 kB

        Activity

          drulli Ulli Hafner added a comment -

          Is this a freestyle or maven-plugin project?

          drulli Ulli Hafner added a comment - Is this a freestyle or maven-plugin project?
          drulli Ulli Hafner added a comment -

          Can you please attach the console log (grep with [CHECKSTYLE] or [FINDBUGS]).

          drulli Ulli Hafner added a comment - Can you please attach the console log (grep with [CHECKSTYLE] or [FINDBUGS] ).

          It's a maven job (item "maven project"), not a freestyle project.

          Attached the log. 

          bish Bukama Marenellin added a comment - It's a maven job (item "maven project"), not a freestyle project. Attached the log. 
          drulli Ulli Hafner added a comment -

          Seems that the checkstyle maven plugin produces an aggregation report for the bean:

          [CHECKSTYLE] Parsing file /var/opt/jenkins/jenkins_server/jobs/***_***_Bean_BUILD/workspace/***_Bean/target/checkstyle-result.xml
          

          There is no option in the plugin to skip results that are produced by maven. Isn't it possible to configure the pom.xml so that this does not occur? (FindBugs and PMD maven plugins seem not to show the behavior.)

          drulli Ulli Hafner added a comment - Seems that the checkstyle maven plugin produces an aggregation report for the bean: [CHECKSTYLE] Parsing file /var/opt/jenkins/jenkins_server/jobs/***_***_Bean_BUILD/workspace/***_Bean/target/checkstyle-result.xml There is no option in the plugin to skip results that are produced by maven. Isn't it possible to configure the pom.xml so that this does not occur? (FindBugs and PMD maven plugins seem not to show the behavior.)

          Yes it seems that the aggregation is triggered by the maven-site-plugin ( manuel I'll try to disable it.

          Aggregation of reports also [affects other (maven) plugins|http://bartswennenhuis.nl/maven-aggregate-reports-for-multi-module-projects|http://bartswennenhuis.nl/maven-aggregate-reports-for-multi-module-projects].]. So not a specific checkstyle problem.

          bish Bukama Marenellin added a comment - Yes it seems that the aggregation is triggered by the maven-site-plugin ( manuel  I'll try to disable it. Aggregation of reports also [affects other (maven) plugins| http://bartswennenhuis.nl/maven-aggregate-reports-for-multi-module-projects |http://bartswennenhuis.nl/maven-aggregate-reports-for-multi-module-projects].]. So not a specific checkstyle problem.

          Just as an status report: I don't get the right configuration to skip the aggregated reports - I think I'm doing something wrong. But maybe you can add a feature to skip the aggregated ones to the jenkins plugin.

          bish Bukama Marenellin added a comment - Just as an status report: I don't get the right configuration to skip the aggregated reports - I think I'm doing something wrong. But maybe you can add a feature to skip the aggregated ones to the jenkins plugin.

          People

            drulli Ulli Hafner
            bish Bukama Marenellin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: