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

CheckStyle-Plugin doubles violations in maven multi module projects

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: checkstyle-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.19.3, checkstyle-plugin: 3.47
    • Similar Issues:

      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

          Hide
          drulli Ulli Hafner added a comment -

          Is this a freestyle or maven-plugin project?

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

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

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

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

          Attached the log. 

          Show
          bish Bukama Marenellin added a comment - It's a maven job (item "maven project"), not a freestyle project. Attached the log. 
          Hide
          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.)

          Show
          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.)
          Hide
          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.

          Show
          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.
          Hide
          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.

          Show
          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

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

              Dates

              • Created:
                Updated:
                Resolved: