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

"Publish Findbugs" stops Maven web site publishing, not publishing Findbugs reports

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: findbugs-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.615 running on Windows 7 Enterprise SP1 on X64
      Findbugs Plugin 4.6.0
      PMD Plugin 3.41
      Static Analysis Collector Plugin 1.43
      Static Analysis Utilities 1.71
      Maven 3.3.3
      Findbugs 3.0.1
    • Similar Issues:

      Description

      After getting a small Maven demonstration project working within Jenkins, I attempted to add the static analysis reports, installing the Static Analysis Utilities and Collector and the Findbugs Plugin. I tried several settings but was never able to see a FindBugs report on the Jenkins build status page, and eventually noticed that the 'Maven-generated site' link disappeared from the left-hand side of my project links.

      Ultimately I traced this down to: If "Publish Findbugs analysis results" is checked in the Build Settings area below "Add post-build step", no link is generated; if it is unchecked, the Maven web site link appears.

      The log files are instructive: near the end of a successful build I see the following, which seems to show the web site tree copy to where Jenkins stores the web site:
      00:01:02.137 [INFO] Cobertura Report generation was successful.
      00:01:02.137 [INFO] Generating "CPD" report — maven-pmd-plugin:3.4:cpd
      00:01:02.168 [INFO] Generating "PMD" report — maven-pmd-plugin:3.4:pmd
      00:01:02.324 [JENKINS] Archiving site from C:\Program Files (x86)\Jenkins\workspace\VizCommon\target\site to C:\Program Files (x86)\Jenkins\jobs\VizCommon\site

      Near the end of a failed build I see this instead
      00:01:04.536 [INFO] Generating "CPD" report — maven-pmd-plugin:3.4:cpd
      00:01:04.581 [INFO] Generating "PMD" report — maven-pmd-plugin:3.4:pmd
      00:01:05.345 log4j:WARN No appenders could be found for logger (org.apache.commons.digester3.Digester.sax).
      00:01:05.345 log4j:WARN Please initialize the log4j system properly.
      00:01:06.534 [WARNING] Using default org.dom4j.DocumentFactory
      00:01:06.553 [WARNING] Using default org.dom4j.DocumentFactory
      00:01:06.595 [WARNING] Using default org.dom4j.DocumentFactory
      00:01:06.596 [WARNING] Using default org.dom4j.DocumentFactory
      00:01:06.885 [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: null
      00:01:06.885 [INFO]
      00:01:06.885 [INFO] — maven-resources-plugin:2.6:resources (default-resources) @ viz-common —

      Note that I only enabled Findbugs reporting, even though Maven successfully generates the PMD and Cobertura reports (I had installed the Cobertura plugin but first disabled, then uninstalled it. I suspect the problem is with Findbugs (see PMD test below).

      I thought this might be related to JENKINS-26923, which suggested a problem with common-io (although I believe my version of the SA tool includes that bug's fix); so I stopped Jenkins, renamed commons-io-2.2.jar and restarted; but re-running a "Publish Findbugs" build still presented the log4j and dom4j warnings and no web site.

      I suspect (or hope) these errors are not only causing the Maven web site to not be published, but may be why I never saw a link to Findbugs reports.

      I did also try the case where "Publish PMD analysis results" is checked (only, with the Findbugs box unchecked). In that case I saw the log4j warnings, but not the dom4j warnings; the web site did publish - and I also got a PMD link.

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          I'm not sure if I understand correctly: is the findbugs report not shown or is the web site generation broken, or both?

          You can not use the site goal to publish the findbugs result within Jenkins, please use the findbugs:findbugs goal. Otherwise the reports are not picked up.

          Show
          drulli Ulli Hafner added a comment - I'm not sure if I understand correctly: is the findbugs report not shown or is the web site generation broken, or both? You can not use the site goal to publish the findbugs result within Jenkins, please use the findbugs:findbugs goal. Otherwise the reports are not picked up.
          Hide
          jelion John Elion added a comment - - edited

          First, thank you your comment and suggestion.

          Both. When "Publish Findbugs..." is checked, the "Maven generated website" link stops appearing (and the related log messages appear) and when it is unchecked, the link comes back. And, I have never seen anything on the project or build page related to Findbugs results.

          I went back and added "findbugs:findbugs" to the Maven goals - that is, the goals were changed to "site findbugs:findbugs install". I did not remove findbugs from <reporting> (it comes from a corporate "master" pom) I understand that means Findbugs is executed twice right now. I saw neither the web site nor the findbugs report in my project page, and my build status page did not show Findbugs results. My log showed this:
          00:02:36.009 [INFO] Generating "CPD" report — maven-pmd-plugin:3.4:cpd
          00:02:36.040 [INFO] Generating "PMD" report — maven-pmd-plugin:3.4:pmd
          00:02:36.539 log4j:WARN No appenders could be found for logger (org.apache.commons.digester3.Digester.sax).
          00:02:36.539 log4j:WARN Please initialize the log4j system properly.
          00:02:37.725 [WARNING] Using default org.dom4j.DocumentFactory
          00:02:37.756 [WARNING] Using default org.dom4j.DocumentFactory
          00:02:37.819 [WARNING] Using default org.dom4j.DocumentFactory
          00:02:37.819 [WARNING] Using default org.dom4j.DocumentFactory
          00:02:38.162 [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: null
          00:02:38.162 [INFO]
          00:02:38.162 [INFO] — findbugs-maven-plugin:3.0.1:findbugs (default-cli) @ viz-common —
          00:02:39.004 [INFO] Fork Value is true
          00:02:56.383 [java] Warnings generated: 114
          00:02:56.492 [INFO] Done FindBugs Analysis....
          00:02:57.179 [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Could not initialize class edu.umd.cs.findbugs.SortedBugCollection

          Show
          jelion John Elion added a comment - - edited First, thank you your comment and suggestion. Both. When "Publish Findbugs..." is checked, the "Maven generated website" link stops appearing (and the related log messages appear) and when it is unchecked, the link comes back. And, I have never seen anything on the project or build page related to Findbugs results. I went back and added "findbugs:findbugs" to the Maven goals - that is, the goals were changed to "site findbugs:findbugs install". I did not remove findbugs from <reporting> (it comes from a corporate "master" pom) I understand that means Findbugs is executed twice right now. I saw neither the web site nor the findbugs report in my project page, and my build status page did not show Findbugs results. My log showed this: 00:02:36.009 [INFO] Generating "CPD" report — maven-pmd-plugin:3.4:cpd 00:02:36.040 [INFO] Generating "PMD" report — maven-pmd-plugin:3.4:pmd 00:02:36.539 log4j:WARN No appenders could be found for logger (org.apache.commons.digester3.Digester.sax). 00:02:36.539 log4j:WARN Please initialize the log4j system properly. 00:02:37.725 [WARNING] Using default org.dom4j.DocumentFactory 00:02:37.756 [WARNING] Using default org.dom4j.DocumentFactory 00:02:37.819 [WARNING] Using default org.dom4j.DocumentFactory 00:02:37.819 [WARNING] Using default org.dom4j.DocumentFactory 00:02:38.162 [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: null 00:02:38.162 [INFO] 00:02:38.162 [INFO] — findbugs-maven-plugin:3.0.1:findbugs (default-cli) @ viz-common — 00:02:39.004 [INFO] Fork Value is true 00:02:56.383 [java] Warnings generated: 114 00:02:56.492 [INFO] Done FindBugs Analysis.... 00:02:57.179 [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Could not initialize class edu.umd.cs.findbugs.SortedBugCollection
          Hide
          drulli Ulli Hafner added a comment -

          I see. Seems another class loading problem with the maven-plugin of Jenkins. Workaround: you can avoid such troubles when using the freestyle project type.

          Show
          drulli Ulli Hafner added a comment - I see. Seems another class loading problem with the maven-plugin of Jenkins. Workaround: you can avoid such troubles when using the freestyle project type.
          Hide
          jelion John Elion added a comment -

          I did try to create a freestyle project, and with it I did get the Findbugs link. Still saw the org.log4j messages, not sure if they are significant - they do seem to be related.

          I'm not sure if we'll be able to use freestyle projects or not - I did notice we lost some other things (the Maven variant seems to know the downstream project build sequence, for example, and automatically populates the build's project web site to the project page.)

          Thank you for your suggestions.

          Show
          jelion John Elion added a comment - I did try to create a freestyle project, and with it I did get the Findbugs link. Still saw the org.log4j messages, not sure if they are significant - they do seem to be related. I'm not sure if we'll be able to use freestyle projects or not - I did notice we lost some other things (the Maven variant seems to know the downstream project build sequence, for example, and automatically populates the build's project web site to the project page.) Thank you for your suggestions.
          Hide
          drulli Ulli Hafner added a comment -

          Is this related to JENKINS-22252?

          Show
          drulli Ulli Hafner added a comment - Is this related to JENKINS-22252 ?
          Hide
          drulli Ulli Hafner added a comment -

          Should work with the latest maven-plug-in. If not please reopen.

          Show
          drulli Ulli Hafner added a comment - Should work with the latest maven-plug-in. If not please reopen.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              jelion John Elion
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: