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

FindBugs report failing Maven job - only if JUnit tests are present



    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Labels:
    • Environment:
      Jenkins 2.61
      FindBugs plug-in 4.70
      Static Analysis Utilities 1.86
      Java 8
      Maven 3.2.5/3.3.9/... (doesn't matter); findbugs-maven-plugin 3.0.1
    • Similar Issues:


      When a Maven job is processing the generated xml reports, it fails about the moment I'd expect it processing the FindBugs report:

      [INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.8
      [WARNING] Using default org.dom4j.DocumentFactory
      [WARNING] Using default org.dom4j.DocumentFactory
      [WARNING] Using default org.dom4j.DocumentFactory
      [WARNING] Using default org.dom4j.DocumentFactory
      [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: null

      The Maven job did successfully generate FindBugs, PMD, CPD, Cobertura, ... xml reports in the workspace target directory. However, after this error, those XML reports don't get collected and published on the job page.


      This error can be avoided on my setup by either:

      • In the job configuration, deselecting the option to publish FindBugs reports. (but of course, we want to have those published)
      • Not having any JUnit tests in the project. (e.g. simply renaming the "test" directory, so tests don't get picked up by Maven). Note that I leave all test and surefire related Maven and jenkins configuration, plug-ins and dependencies as-is (I'm not removing any configuration or plug-ins). So job is identical, just without its test source directory in the workspace.

      Without JUnit test dir, the above error does NOT occur, and FindBugs report collection works fine. (and subsequently PMD, CPD, Cobertura)

      Without any tests available, it nicely does the following:

      [INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.8
      [FINDBUGS] Searching for all files in C:\Users\ ... etc ...


      The error is similar to JENKINS-28650 , however it is remarkable that the mere presence of JUnit tests "breaks" FindBugs report collection?

      • Maybe this might shed a new light on the issue?
        Maybe this can point someone in a new direction to track down the cause...

      I have no idea what test-related element could have an impact? Caused by Maven internals? Caused by jenkins internal? Related to the jenkins maven-plugin , the jenkins junit-plugin, or so? Other cause?


      Note that this worked flawlessly so far as long as we were using Maven 2. (with older findbugs-maven-plugin)

      Also, switching to a freestyle jenkins job (or pipeline job) is not the preferred solution: it would require re-creating 150 jobs (!!!); it would loose essential functionality as automatic SNAPSHOT job dependencies (complicating creation of each now job for the jenkins users); etc. In other words, it would be a step back from a useful jenkins feature and selling-point.






            Unassigned Unassigned
            belpk K P
            0 Vote for this issue
            2 Start watching this issue